JspiderSF jspidersf_wiki https://jspidersf.shoutwiki.com/wiki/Main_Page MediaWiki 1.35.13 first-letter Media Special Talk User User talk JspiderSF JspiderSF talk File File talk MediaWiki MediaWiki talk Template Template talk Help Help talk Category Category talk Module Module talk Gadget Gadget talk Gadget definition Gadget definition talk Main Page 0 1 167 166 2018-07-31T21:33:18Z Jspidersf 30511844 167 wikitext text/x-wiki {{MainTemplate | welcome = Welcome to '''{{SITENAME}}!''' | blurb = Wiki-Based Documentation Prototype | about_title = About this site | about_content = This site is an example of using MediaWiki for documentation projects. This is hosted on ShoutWiki. Support is available from ShoutWiki's [[Special:ListUsers/staff|Customer Support Team]]. | featured_title = Documentation Examples | featured_content = * [[SF Department of Technology:Creating DT Requisitions in PeopleSoft]] * [[SF Department of Technology:Staging Vouchers in PeopleSoft]] | didyouknow_title = Did you know... | didyouknow_content = * ...that you can edit this page? Yes you! Click "edit" above, or click "help" to learn more about how MediaWiki works. | news_title = News | news_content = * This wiki was started! }} q91miyimo2e1fxunveobndeiflp95fl Main Page 0 1 167 166 2018-07-31T21:33:18Z Jspidersf 30511844 167 wikitext text/x-wiki {{MainTemplate | welcome = Welcome to '''{{SITENAME}}!''' | blurb = Wiki-Based Documentation Prototype | about_title = About this site | about_content = This site is an example of using MediaWiki for documentation projects. This is hosted on ShoutWiki. Support is available from ShoutWiki's [[Special:ListUsers/staff|Customer Support Team]]. | featured_title = Documentation Examples | featured_content = * [[SF Department of Technology:Creating DT Requisitions in PeopleSoft]] * [[SF Department of Technology:Staging Vouchers in PeopleSoft]] | didyouknow_title = Did you know... | didyouknow_content = * ...that you can edit this page? Yes you! Click "edit" above, or click "help" to learn more about how MediaWiki works. | news_title = News | news_content = * This wiki was started! }} q91miyimo2e1fxunveobndeiflp95fl SF Department of Technology:Creating DT Requisitions in PeopleSoft 0 33 168 161 2018-07-31T21:35:17Z Jspidersf 30511844 /* DT-Specific Guidance for Creating Requisitions */ 168 wikitext text/x-wiki == Introduction == After years of preparation, months of training, and even more months of delay, the City and County of San Francisco has taken the plunge: goodbye to the decrepit, mainframe world of FAMIS, and hello to the modern, web-based world of PeopleSoft to manage every transaction in the City’s $10 billion budget! The [https://sfemployeeportalsupport.sfgov.org/support/home SF Employee Portal] contains a wealth of training and job aides designed for the citywide audience of budget, accounting, and procurement teams. We have tested the [https://sfemployeeportalsupport.sfgov.org/support/solutions/articles/22000209326-create-a-requisition SF Employee Portal], and it is technically accurate. It contains 97% of what you need to know to successfully create a requisition for the Department of Technology. This document will fill in that missing 3%, warn you of potential pitfalls, and stiffen your spine to jump into the future. == Pep Talk and a Word of Caution == We all know that the PeopleSoft rollout remains a work in progress: errors in contract conversion are still being uncovered, most vendors still lack access, many budget codes are confusing or incorrect, individual role-mapping appears to be . . . creative? BUT, the PeopleSoft system is live, FAMIS is now frozen, and our ability to keep the lights and Internet on for the City depends on our ability to start flying this plane while the support team finishes building it. {{caution|The City made the decision to make this an open system. This essentially means that “trust is given, not earned.” We have visibility and access to budgets outside of DT’s. This, combined with the bugs in the system, mean it can be easy to accidentally misroute our requisitions, purchase orders, and contracts. '''''It’s not the end of the world if-and-when mistakes happen!''''' This guide will help you avoid some pitfalls, but there will undoubtedly be more pitfalls. That’s okay! If we can’t correct an errant requisition, we can always delete it and start over. Take a deep breath, pour another cup of coffee, and we’ll begin.}} == What You Need and Where to Get It == Before you login to the PeopleSoft system, we suggest you first take a few minutes to gather all of the information you will need. If your requisition has missing budget codes, you want to find out now before you invest the time to start entering all the information. Here is what you need to create a DT requisition: * [https://sfemployeeportalsupport.sfgov.org/support/solutions/articles/22000209326-create-a-requisition eProcurement: Create a Requisition job aide] * This DT-specific supplemental guide * PeopleSoft budget codes for your requisition {{tip|The PeopleSoft budget codes provide the key information to ensure that your requisition is attached to the correct portion of the budget and routed to the correct approval path.}} === Determining PeopleSoft Budget Codes === There are two main sources for determining the new PeopleSoft budget codes for your requisition: * [[#ServiceNow_Procurement_Ticket|ServiceNow Procurement Ticket]] * [[#DT_FY17-18_Budget_Spreadsheet|DT FY17-18 Budget Spreadsheet]] ==== ServiceNow Procurement Ticket ==== To locate the PeopleSoft budget codes in a ServiceNow procurement ticket: 1. Navigate to the ServiceNow procurement ticket for your requisition. 2. Scroll down to '''Procurement Information''' section. By default, the '''Budget Section''' tab is displayed. 3. Click on the '''Funding Information''' tab. There you will (hopefully) see the six PeopleSoft (PS) codes needed to define the requisition! [[File:SN-funding.png|500px|thumb|none|caption|ServiceNow Funding Information tab]] ==== DT FY17-18 Budget Spreadsheet ==== But what if you are working off an old ServiceNow procurement ticket (created before 6/1/17)? DT Budget staff are in the process of mapping PeopleSoft codes to DT Budget Line Items in the spreadsheet, [https://sfgov1.sharepoint.com/sites/TIS/Finance/BudgetFinancial/SitePages/Home.aspx FY17-18_DT_Budget-ACTIVE.xls], which is posted on DT Budget’s SharePoint home page: [[File:SP-budget-page.png|800px|thumb|none|caption|DT Budget Spreadsheet SharePoint home page]] In the spreadsheet, simply search for the DT Budget Line Item for your requisition and then scroll over to locate the PeopleSoft codes. [[File:DT-budget-spreadsheet.png|800px|thumb|none|caption|Budget Codes in DT Budget Spreadsheet]] == DT-Specific Guidance for Creating Requisitions == The following sections provide additional information that is not covered by the [https://sfemployeeportalsupport.sfgov.org/support/solutions/articles/22000209326-create-a-requisition eProcurement: Create a Requisition job aid]: * [[#Entering_the_Requisition_Name|Entering the Requisition Name]] * [[#Entering_Bulk_Budget_Codes|Entering Bulk Budget Codes]] * [[#Adding_new_Items_to_PeopleSoft|Adding new Items to PeopleSoft]] * [[#Confirming_the_Approval_Path|Confirming the Approval Path]] === Entering the Requisition Name === DT has adopted the following naming convention for requisitions to ensure consistency and make the best use of the 30-character limit: '''DT''' 'ServiceNow-ticket-number brief-description' The following screenshot shows the requisition name for ServiceNow ticket 0102084, which is for the renewal of LinkedIn corporate recruiting seats. [[File:PS-RQ-name.png|600px|thumb|none|caption|PeopleSoft Requisition Name]] We know the 30-character limit for names is arbitrary and annoying. Until this is fixed, we will just need to get creative with our abbreviations. ¯\_(ツ)_/¯ === Entering Bulk Budget Codes === We can now enter the PeopleSoft budget codes once and apply them to all items in the requisition! We no longer need to re-enter them for every. single. item. To enter bulk budget codes, perform the following steps: # From the “Requisition” page (Main Menu>eProcurement>Requisition), click '''Requisition Settings'''. # In the “Requisition Settings” page, scroll down to the “Accounting Defaults” section. # Enter the values for the PeopleSoft budget codes in the Account, Fund, Dept, Authority, Project, and Activity Code fields. #: #:[[File:PS-RQ-chartfields.png|600px|thumb|none|caption|PeopleSoft Requisition Bulk Budget Codes]] #: {{Tip|The PeopleSoft system will allow you to enter invalid budget codes. To avoid this error, pause for a second after entering each code and doublecheck that the PeopleSoft auto-complete function displays the correct code number and description.}} <ol start="4"> <li>Click '''OK'''. The budget codes will be applied to all line items in the requisition!</li></ol> === Adding new Items to PeopleSoft === If any items in your requisition are not yet in the PeopleSoft database, you can now manually add them, by performing the following steps: # From the “Requisition” page (Main Menu>eProcurement>Requisition), click '''Add More Items'''. # Click '''Special Requests''' to display the “Special Requests” window. #: #:[[File:PS-RQ-special-requests.png|600px|thumb|none|caption|PeopleSoft Requisition > Special Requests]] #: # Enter values for the following fields: ## ''Item Description'' ## ''Price'' ## ''Quantity'' ## ''Unit of Measure '' ## ''Category'' ## ''Supplier ID '' {{tip| Note that the values for '''Category''' and '''Supplier ID''' are limited to values that are configured in the PeopleSoft database. If you don’t have these values, click the magnifying glass to search. The '''Supplier Name''' value auto-populates when you enter the '''Supplier ID'''.}} === Confirming the Approval Path === We know that of all the issues with PeopleSoft, the requisition approval process has created the most consternation and gnashing of teeth. We have escalated these issues, and the Controller assures us they are working on it. BUT, until they do, we can still solve many of the common issues we’ve been encountering. Take a deep breath, and let’s proceed. Once you have fully entered your requisition, perform the following steps to determine if the approval path is correct. # Once you’ve completed entering your requisition, click the '''Preview Approvals''' button. # Under the FSP Requisition Approval section, you should see boxes for two approvers: “Requisition A1 Approver” and “Requisition A2 Approver.” If you see more or less than two approvers, something has gone awry, and you will need to open a support ticket. #: [[File:PS-RQ-preview-approvals.png|600px|thumb|none|caption|PeopleSoft Requisition Approvers]] <ol start="3"> <li>Click on the '''Multiple Approvers''' link above “Requisition A1 Approver” and search for your manager’s name in the pop-up window that displays. If you do not find your manager’s name, you will need to open a support ticket. </li><li>Click on the '''Multiple Approvers''' link above “Requisition A2 Approver” and search for your OCA liaison’s name in the pop-up window that displays. If you do not find your OCA liaison’s name, proceed to Troubleshooting the Approval Path. </li> {{caution|There will likely be many unfamiliar and strange names listed in both lists of approvals. Some of this is intentional, some of this is unintentional. The Controller’s office is aware of this and working to fix it. But do not fear. These strange names will not adversely affect your requisition.}} <li> If both your manager and OCA liaison are listed in the approval path, you have succeeded! Click the '''Return''' button to return to the “Requisitions” page and click '''Submit for Approval'''. Take a moment to bask in the well-deserved sense of accomplishment. </li> of2yudui3hhnxffzwtg1jwdic2vwh1x User:MediaWiki default 2 23 35 34 2010-12-30T05:43:26Z MediaWiki default 30443056 35 wikitext text/x-wiki This account is used by [[s:ShoutWiki Staff|ShoutWiki Staff]] when performing maintenance tasks. This account is not a bot and cannot be blocked. If there is a problem with an edit from this account, please inform a member of the [[s:Customer Support Team|Customer Support Team]] using [[Special:Contact]]. Thanks, ShoutWiki Staff 8u83a4eosok8vsr2v7vagsq052zlpfg User talk:Cook879 3 27 41 40 2012-09-08T10:46:56Z MediaWiki default 30443056 41 wikitext text/x-wiki {| align="center" style="background: #ccf; border: 3px solid #8888AA; width: 100%; -moz-border-radius: 80px;" |- | Hi. Welcome to my talk page. Feel free to [http://{{SERVERNAME}}/w/index.php?title=User_talk:Cook879&action=edit&section=new post a message] below. |} r3ikw28tsv3q58cksiya005d2t1n0ig User talk:Jspidersf 3 32 48 2018-07-24T00:07:39Z ShoutWiki 11 48 wikitext text/x-wiki Hi Jspidersf, thank you for choosing ShoutWiki to make your wiki. We would suggest that you start your wiki off by doing these few basic things: *Upload a logo. You can do this by uploading an image over [[:File:Wiki.png]]. (not available on some skins) *Design your [[Main Page]]. The main page is likely the first thing users will see. It should be attractive and catch the eye. *Start building content. All wikis need content to become the best they can be. If you need help with making a logo, skin or favicon, please see [[s:w:logocreation|ShoutWiki's Logo Creation Wiki]]. If you need any help with building your wiki, feel free to contact [[s:ShoutWiki Staff|ShoutWiki staff]] either via their talk pages or via [[Special:Contact]]. Alternatively, you can talk to us, or other users, via [[s:ShoutWiki Hub:IRC|IRC]]. Thank you again for using ShoutWiki. [[s:ShoutWiki Staff|ShoutWiki staff]] 00:06, 24 July 2018 3eofqfz0inil4o2rhwx5cyex60keadw User talk:Lcawte 3 29 43 2013-03-28T18:59:56Z MediaWiki default 30443056 43 wikitext text/x-wiki {{s::User talk:Lcawte/header}} 68cjp69hrs0otmdn18l1a2b85wzrzyp User talk:Solar Dragon 3 31 46 45 2013-08-21T21:30:04Z MediaWiki default 30443056 46 wikitext text/x-wiki {{s::User:Solar Dragon/Talkheader}} o2y3a4p2midvn09l97rwprgfdpfgdbp File:Caution.png 6 75 103 2018-07-30T18:46:12Z Jspidersf 30511844 Caution 103 wikitext text/x-wiki Caution a07lxlexe7iya1c3m5jmcvjowfwfq1y File:DT-budget-spreadsheet.png 6 79 131 2018-07-30T19:15:26Z Jspidersf 30511844 131 wikitext text/x-wiki phoiac9h4m842xq45sp7s6u21eteeq1 File:Lightbulb.png 6 76 104 2018-07-30T18:46:41Z Jspidersf 30511844 Note / tip / lightbulb 104 wikitext text/x-wiki Note / tip / lightbulb kgdg2gn22r54pa2xg073q9jcvmnl54g File:PS-RQ-chartfields.png 6 80 132 2018-07-30T19:15:40Z Jspidersf 30511844 132 wikitext text/x-wiki phoiac9h4m842xq45sp7s6u21eteeq1 File:PS-RQ-name.png 6 81 133 2018-07-30T19:15:55Z Jspidersf 30511844 133 wikitext text/x-wiki phoiac9h4m842xq45sp7s6u21eteeq1 File:PS-RQ-preview-approvals.png 6 82 134 2018-07-30T19:16:11Z Jspidersf 30511844 134 wikitext text/x-wiki phoiac9h4m842xq45sp7s6u21eteeq1 File:PS-RQ-special-requests.png 6 83 135 2018-07-30T19:16:36Z Jspidersf 30511844 135 wikitext text/x-wiki phoiac9h4m842xq45sp7s6u21eteeq1 File:SN-funding.png 6 84 136 2018-07-30T19:16:45Z Jspidersf 30511844 136 wikitext text/x-wiki phoiac9h4m842xq45sp7s6u21eteeq1 File:SP-budget-page.png 6 85 137 2018-07-30T19:16:54Z Jspidersf 30511844 137 wikitext text/x-wiki phoiac9h4m842xq45sp7s6u21eteeq1 File:Warning.png 6 77 105 2018-07-30T18:46:53Z Jspidersf 30511844 warning 105 wikitext text/x-wiki warning 6kjfuilj4lljazvmwndhc8h8s2ryh82 File:Wiki.png 6 28 42 2012-09-13T14:06:18Z MediaWiki default 30443056 42 wikitext text/x-wiki Wiki logo. Upload a new image over this one to set your own logo. dgwmv2n7qsfzlck7bqxtq40b45oxer2 Template:Caution 10 35 125 124 2018-07-30T19:13:06Z Jspidersf 30511844 125 wikitext text/x-wiki <blockquote style="background-color: #fff9d5; border: none;"> {| | [[File:caution.png|left|top]] | {{{1}}} |} </blockquote> nh292k5ycbftnwlrgn5n7ltsqkm2yuc Template:Caution/en 10 56 83 2018-07-24T23:39:12Z Jspidersf 30511844 Created page with "<languages/> <onlyinclude>{{#switch: | = {{#if: {{{1|}}}|<table cellspacing="0" cellpadding="0" border="0" style="background:transparent; margin-top:0.5em; border:1px #b52 sol..." 83 wikitext text/x-wiki <languages/> <onlyinclude>{{#switch: | = {{#if: {{{1|}}}|<table cellspacing="0" cellpadding="0" border="0" style="background:transparent; margin-top:0.5em; border:1px #b52 solid; padding:0.5em; background-color:#fef7f5"><tr><td nowrap="true" valign="top">}}[[File:Nuvola apps important.svg|18px|text-bottom|link=|Caution!]] '''Caution:''' {{#if:{{{1|}}}|</td><td valign="top" style="padding-{{dir|{{pagelang}}|right|left}}:0.5em"> {{{1|}}}</td></tr></table>|&#32;}} | #default= {{#invoke:Template translation|renderTranslatedTemplate|template=Template:Caution|noshift=1}} }}</onlyinclude> {{ {{TNTN|documentation}} |content= == Usage == === Method 1 === The following displays the Caution icon and the word 'Caution:'. You can follow this with whatever text/images/markup you like. <pre>{{Caution}} Here is my note.</pre> {{Caution}} Here is my ''Caution'' message. === Method 2 === The following includes the text passed to the template, and uses a table to stop the text flowing round the icon. <pre>{{Caution|Here is a long ''Caution'' message, which is sufficiently wordy to run onto a second line, which would normally cause it to wrap round the icon, but because we passed it as a parameter it keeps its left alignment straight.}}</pre> {{Caution|Here is a long ''caution'' message, which is sufficiently wordy to run onto a second line, which would normally cause it to wrap round the icon, but because we passed it as a parameter it keeps its left alignment straight.}} }} [[Category:Templates{{#translation:}}]] n4g3pw0kiksxp6kbxha49k98auubkzv Template:Dir 10 36 63 2018-07-24T23:29:29Z Jspidersf 30511844 Created page with "{{#switch:{{lc:{{#if:{{{lang|}}}|{{{lang|}}}|{{#if:{{{1|}}}|{{{1|}}}|{{int:lang}}}}}}}} |ar|arc|arz|azb|bcc|ckb|bqi|dv|fa|fa-af|glk|ha|he|kk-arab|kk-cn|ks|ku-arab|mzn|pnb|prd|..." 63 wikitext text/x-wiki {{#switch:{{lc:{{#if:{{{lang|}}}|{{{lang|}}}|{{#if:{{{1|}}}|{{{1|}}}|{{int:lang}}}}}}}} |ar|arc|arz|azb|bcc|ckb|bqi|dv|fa|fa-af|glk|ha|he|kk-arab|kk-cn|ks|ku-arab|mzn|pnb|prd|ps|sd|ug|ur|ydd|yi ={{#if:{{{rtl|}}}|{{{rtl|}}}|{{#if:{{{2|}}}|{{{2|}}}|rtl}}}} |#default ={{#if:{{{ltr|}}}|{{{ltr|}}}|{{#if:{{{3|}}}|{{{3|}}}|ltr}}}} }}<noinclude>{{documentation}}</noinclude> s4qx401a1vs227dxfhb6xjlwcoxiztk Template:Dir/Doc 10 59 86 2018-07-24T23:44:59Z Jspidersf 30511844 Created page with "{{Documentation subpage}} ; Usage : Outputs "<tt>rtl</tt>" for right-to-left languages else "<tt>ltr</tt>". : The default returned values "<tt>rtl</tt>" and "<tt>ltr</tt>" can..." 86 wikitext text/x-wiki {{Documentation subpage}} ; Usage : Outputs "<tt>rtl</tt>" for right-to-left languages else "<tt>ltr</tt>". : The default returned values "<tt>rtl</tt>" and "<tt>ltr</tt>" can also be customized. ; Syntax :* <tt><nowiki>{{</nowiki>dir<nowiki>}}</nowiki></tt> :* <tt><nowiki>{{</nowiki>dir|lang=''language-code''<nowiki>}}</nowiki></tt> :* <tt><nowiki>{{</nowiki>dir|''language-code''<nowiki>}}</nowiki></tt> :*: The 1st (optional) parameter ''language-code'' (whose value may be passed alternatively by name as <tt>|lang=</tt>) should be conforming to BCP47, as required by web standards (HTML/CSS...), rather than Wikimedia labels for designating languages in domain names (in some cases, Wikimedia language codes are not conforming and only used for interwikis and URLs; most of them are being migrated to BCP47, which is based on some parts of the ISO649 standard). :*: If no ''language-code'' parameter is specified, it defaults to the preferred UI language of the visitor viewing the current page, which for ''you'' is currently <tt>{{uselang}}</tt>. :* <tt><nowiki>{{</nowiki>dir|lang=''language-code''|rtl=''return value for RTL scripts''|ltr=''return value for LTR scripts''<nowiki>}}</nowiki></tt> :* <tt><nowiki>{{</nowiki>dir|''language-code''|''return value for RTL scripts''|''return value for LTR scripts''<nowiki>}}</nowiki></tt> :* <tt><nowiki>{{</nowiki>dir|rtl=''return value for RTL scripts''|ltr=''return value for LTR scripts''<nowiki>}}</nowiki></tt> :* <tt><nowiki>{{</nowiki>dir|2=''return value for RTL scripts''|3=''return value for LTR scripts''<nowiki>}}</nowiki></tt> :*: The 2nd and 3rd (optional) parameters allow changing the default return values for languages written in RTL and LTR scripts (respectively), whose default are "<tt>rtl</tt>" and "<tt>ltr</tt>". These return values may be passed alternatively by name as <tt>|rtl=</tt> and <tt>ltr=</tt>. :*: This can be used to customize CSS styles such as text alignment or floatting side or lateral margins/borders/paddings, or to change the displayed text/symbols or names of images/icons depending on the script direction. ; Note : Currently it recognizes the following codes of languages usually written in a right-to-left script: : <tt>ar | arc | arz | azb | bcc | ckb | bqi | dv | fa | fa-af | glk | ha | he | kk-arab | kk-cn | ks | ku-arab | mzn | pnb | prd | ps | sd | ug | ur | ydd | yi</tt> : All other languages will be assumed to use a left-to-right script. ; Examples :* <tt><nowiki>{{dir}}</nowiki></tt>, for the current user language which is {{#language:{{uselang}}|en}} (<span lang="{{uselang}}" dir="{{dir|{{uselang}}}}">{{#language:{{uselang}}}}</span>), returns <tt>{{dir}}</tt>. :* <tt><nowiki>{{dir|en}}</nowiki></tt>, for {{#language:en|en}} (<span lang="en" dir="{{dir|en}}">{{#language:en}}</span>), returns <tt>{{dir|en}}</tt>. :* <tt><nowiki>{{dir|lang=en}}</nowiki></tt>, for {{#language:en|en}} (<span lang="en" dir="{{dir|en}}">{{#language:en}}</span>), returns <tt>{{dir|lang=en}}</tt>. :* <tt><nowiki>{{dir|ar}}</nowiki></tt>, for {{#language:ar|en}} (<span lang="ar" dir="{{dir|ar}}">{{#language:ar}}</span>), returns <tt>{{dir|ar}}</tt>. :* <tt><nowiki>{{dir|yi}}</nowiki></tt>, for {{#language:yi|en}} (<span lang="yi" dir="{{dir|yi}}">{{#language:yi}}</span>), returns <tt>{{dir|yi}}</tt>. :* <tt><nowiki>{{dir|2=right|3=left}}</nowiki></tt>, for the current user language which is {{#language:{{uselang}}|en}} (<span lang="{{uselang}}" dir="{{dir|{{uselang}}}}">{{#language:{{uselang}}}}</span>), returns <tt>{{dir|2=right|3=left}}</tt>. :* <tt><nowiki>{{dir|rtl=right|ltr=left}}</nowiki></tt>, for the current user language which is {{#language:{{uselang}}|en}} (<span lang="{{uselang}}" dir="{{dir|{{uselang}}}}">{{#language:{{uselang}}}}</span>), returns <tt>{{dir|rtl=right|ltr=left}}</tt>. :* <tt><nowiki>{{dir|en|right|left}}</nowiki></tt>, for {{#language:en|en}} (<span lang="en" dir="{{dir|en}}">{{#language:en}}</span>), returns <tt>{{dir|en|right|left}}</tt>. :* <tt><nowiki>{{dir|ar|right|left}}</nowiki></tt>, for {{#language:ar|en}} (<span lang="ar" dir="{{dir|ar}}">{{#language:ar}}</span>), returns <tt>{{dir|ar|right|left}}</tt>. :* <tt><nowiki>{{dir|yi|right|left}}</nowiki></tt>, for {{#language:yi|en}} (<span lang="yi" dir="{{dir|yi}}">{{#language:yi}}</span>), returns <tt>{{dir|yi|right|left}}</tt>. :* <tt><nowiki>{{dir|lang=yi|rtl=right|ltr=left}}</nowiki></tt>, for {{#language:yi|en}} (<span lang="yi" dir="{{dir|yi}}">{{#language:yi}}</span>), returns <tt>{{dir|lang=yi|rtl=right|ltr=left}}</tt>. {{DEFAULTSORT:{{PAGENAME}}}} <includeonly> [[Category:Internationalization templates]] [[Category:formatting templates]] </includeonly> 4njaes77te078x19tl1m9xgfz4fo2kd Template:Documentation 10 37 64 2018-07-24T23:29:54Z Jspidersf 30511844 Created page with "{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude> <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noi..." 64 wikitext text/x-wiki {{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude> <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude> o4ddn701tao1ufdnkxe1wdgz5b5ga84 Template:Documentation subpage 10 60 87 2018-07-24T23:45:36Z Jspidersf 30511844 Created page with "<includeonly><!-- -->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}} | <!--(this template has been transcluded on a /doc or /{{{override}}} page)--> </includeonly><!-..." 87 wikitext text/x-wiki <includeonly><!-- -->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}} | <!--(this template has been transcluded on a /doc or /{{{override}}} page)--> </includeonly><!-- -->{{#ifeq:{{{doc-notice|show}}} |show | {{Mbox | type = notice | style = margin-bottom:1.0em; | image = [[File:Edit-copy green.svg|40px|alt=|link=]] | text = '''This is a [[:en:Wikipedia:Template documentation|documentation]] [[:en:Wikipedia:Subpages|subpage]] for {{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}'''.<br />It contains usage information, [[:en:Wikipedia:Categorization|categories]] and other content that is not part of the original {{#if:{{{text2|}}} |{{{text2}}} |{{#if:{{{text1|}}} |{{{text1}}} |{{#ifeq:{{SUBJECTSPACE}} |{{ns:User}} |{{lc:{{SUBJECTSPACE}}}} template page |{{#if:{{SUBJECTSPACE}} |{{lc:{{SUBJECTSPACE}}}} page|article}}}}}}}}. }} }}<!-- -->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!-- -->{{#if:{{{inhibit|}}} |<!--(don't categorize)--> | <includeonly><!-- -->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}} | [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]] | [[Category:Documentation subpages without corresponding pages]] }}<!-- --></includeonly> }}<!-- (completing initial #ifeq: at start of template:) --><includeonly> | <!--(this template has not been transcluded on a /doc or /{{{override}}} page)--> }}<!-- --></includeonly><noinclude>{{Documentation}}</noinclude> 2iugf39hgv51jg3idi36abgfkcnbki4 Template:GetFallback 10 65 92 2018-07-24T23:49:36Z Jspidersf 30511844 Created page with "{{#switch: {{Uselang|lang={{{1|}}}}} | af | fy | li | nl-informal | vls | zea = nl | arz = ar | be-tarask = be-x-old | be-x-old = be-tarask <!-- same language; be-x-old is use..." 92 wikitext text/x-wiki {{#switch: {{Uselang|lang={{{1|}}}}} | af | fy | li | nl-informal | vls | zea = nl | arz = ar | be-tarask = be-x-old | be-x-old = be-tarask <!-- same language; be-x-old is used on be-x-old.wikipedia but be-tarask is the preferred code --> | crh-cyrl | crh-latn = crh | ckb | mzn | glk = fa | als | bar | de-formal | de-at | de-ch | frr | ksh = de | hif-deva | hif-latn = hif | ike-cans | ike-latn = ike | kk-arab | kk-cyrl | kk-latn | kk-cn | kk-kz | kk-tr = kk | ku-latn | ku-arab = ku | mg | br | co | frp | ht | ty | wa = fr | nds = nds-nl | nds-nl | pdt = nds | pt-br = pt | ruq-cyrl | ruq-grek | ruq-latn = ruq | sr-ec | sr-el = sr | tg-cyrl | tg-latn = tg | tt-cyrl | tt-latn = tt | vec = it | zh | zh-cn | zh-my | zh-sg = zh-hans | zh-hk | zh-mo | zh-tw = zh-hant | szl | csb = pl | en-gb = en | #default = {{#if: {{{default|}}} | {{{default|}}} | en }} }}<noinclude> {{documentation}} </noinclude> li56yfqmgt4pdxf1celbuxxlua2nmal Template:HeaderTemplate 10 7 12 2009-05-02T18:34:55Z MediaWiki default 30443056 12 wikitext text/x-wiki <div> <!-- Beginning of header section --> {|style="width:100%;margin-top:+.7em;background-color:#4682B4;border:1px solid #ccc;-moz-border-radius:20px" |style="width:45%;color:#000"| {|style="width:100%;border:solid 0px;background:none" |- |style="width:100%px;text-align:center;white-space:nowrap;color:#000" | <div style="font-size:195%;border:none;margin: 0;padding:.1em;color:#FFFFFF">{{{welcome}}}</div> |}<!-- Blurb & useful links --> |style="width:45%;font-size:125%;color:#FFFFFF"| {{{blurb}}} |}<!-- End of blurb & useful links --> </div> j3mqpp6bt8r07sw2xdrt404pvemv0ha Template:LangSwitch 10 66 93 2018-07-24T23:50:17Z Jspidersf 30511844 Created page with "{{{ {{#switch: {{{ {{Uselang|lang={{{lang|}}}}} |}}} | ~ = empty | = {{#switch: {{{ {{GetFallback| {{Uselang|lang={{{lang|}}}}} |default=default}} |}}} | ~ = emp..." 93 wikitext text/x-wiki {{{ {{#switch: {{{ {{Uselang|lang={{{lang|}}}}} |}}} | ~ = empty | = {{#switch: {{{ {{GetFallback| {{Uselang|lang={{{lang|}}}}} |default=default}} |}}} | ~ = empty | = {{#switch: {{{ {{GetFallback2| {{Uselang|lang={{{lang|}}}}} |default=default}} |}}} | ~ = empty | = {{#if: {{{default|}}} | default | en }} | #default = {{GetFallback2| {{Uselang|lang={{{lang|}}}}} |default=default}} }} | #default = {{GetFallback| {{Uselang|lang={{{lang|}}}}} |default=default}} }} | #default = {{Uselang|lang={{{lang|}}}}} }} |}}}<noinclude> {{Documentation}} </noinclude> bi28hlblruszfgtas4hawtpzka8wemp Template:Languages 10 57 84 2018-07-24T23:40:41Z Jspidersf 30511844 Created page with "{{nmbox | header = {{ll|Project:Language policy|{{Languages/Title|{{SUBPAGENAME}}}}}} | text = '''[[{{{1|:{{translatable}}}}}|English]]''' {{Languages/Lang|af|{{{1|}}}| }}{..." 84 wikitext text/x-wiki {{nmbox | header = {{ll|Project:Language policy|{{Languages/Title|{{SUBPAGENAME}}}}}} | text = '''[[{{{1|:{{translatable}}}}}|English]]''' {{Languages/Lang|af|{{{1|}}}| }}{{Languages/Lang|ar|{{{1|}}}| }}{{Languages/Lang|ast|{{{1|}}}| }}{{Languages/Lang|az|{{{1|}}}| }}{{Languages/Lang|bcc|{{{1|}}}| }}{{Languages/Lang|be|{{{1|}}}| }}{{Languages/Lang|be-tarask|{{{1|}}}| }}{{Languages/Lang|bg|{{{1|}}}| }}{{Languages/Lang|br|{{{1|}}}| }}{{Languages/Lang|bn|{{{1|}}}| }}{{Languages/Lang|bs|{{{1|}}}| }}{{Languages/Lang|ca|{{{1|}}}| }}{{Languages/Lang|cs|{{{1|}}}| }}{{Languages/Lang|da|{{{1|}}}| }}{{Languages/Lang|de|{{{1|}}}| }}{{Languages/Lang|diq|{{{1|}}}| }}{{Languages/Lang|el|{{{1|}}}| }}{{Languages/Lang|eo|{{{1|}}}| }}{{Languages/Lang|es|{{{1|}}}| }}{{Languages/Lang|fa|{{{1|}}}| }}{{Languages/Lang|fi|{{{1|}}}| }}{{Languages/Lang|fr|{{{1|}}}| }}{{Languages/Lang|gl|{{{1|}}}| }}{{Languages/Lang|gu|{{{1|}}}| }}{{Languages/Lang|he|{{{1|}}}| }}{{Languages/Lang|hi|{{{1|}}}| }}{{Languages/Lang|hu|{{{1|}}}| }}{{Languages/Lang|hy|{{{1|}}}| }}{{Languages/Lang|id|{{{1|}}}| }}{{Languages/Lang|io|{{{1|}}}| }}{{Languages/Lang|it|{{{1|}}}| }}{{Languages/Lang|ja|{{{1|}}}| }}{{Languages/Lang|jv|{{{1|}}}| }}{{Languages/Lang|ka|{{{1|}}}| }}{{Languages/Lang|kk|{{{1|}}}| }}<span class="autonym">{{Languages/Lang|km|{{{1|}}}| }}</span>{{Languages/Lang|ko|{{{1|}}}| }}{{Languages/Lang|ksh|{{{1|}}}| }}{{Languages/Lang|kw|{{{1|}}}| }}{{Languages/Lang|la|{{{1|}}}| }}{{Languages/Lang|map-bms|{{{1|}}}| }}{{Languages/Lang|min|{{{1|}}}| }}{{Languages/Lang|mk|{{{1|}}}| }}{{Languages/Lang|ml|{{{1|}}}| }}<span class="autonym">{{Languages/Lang|mr|{{{1|}}}| }}</span>{{Languages/Lang|ms|{{{1|}}}| }}{{Languages/Lang|nl|{{{1|}}}| }}{{Languages/Lang|no|{{{1|}}}| }}{{Languages/Lang|oc|{{{1|}}}| }}{{Languages/Lang|or|{{{1|}}}| }}{{Languages/Lang|pl|{{{1|}}}| }}{{Languages/Lang|pt|{{{1|}}}| }}{{Languages/Lang|pt-br|{{{1|}}}| }}{{Languages/Lang|ro|{{{1|}}}| }}{{Languages/Lang|ru|{{{1|}}}| }}{{Languages/Lang|si|{{{1|}}}| }}{{Languages/Lang|sk|{{{1|}}}| }}{{Languages/Lang|sl|{{{1|}}}| }}{{Languages/Lang|so|{{{1|}}}| }}{{Languages/Lang|sq|{{{1|}}}| }}{{Languages/Lang|sr|{{{1|}}}| }}{{Languages/Lang|sv|{{{1|}}}| }}{{Languages/Lang|ta|{{{1|}}}| }}{{Languages/Lang|th|{{{1|}}}| }}{{Languages/Lang|tr|{{{1|}}}| }}{{Languages/Lang|uk|{{{1|}}}| }}{{Languages/Lang|vi|{{{1|}}}| }}{{Languages/Lang|yi|{{{1|}}}| }}{{Languages/Lang|yue|{{{1|}}}| }}{{Languages/Lang|zh|{{{1|}}}| }}{{Languages/Lang|zh-hans|{{{1|}}}| }}{{Languages/Lang|zh-hant|{{{1|}}}| }}{{Languages/Lang|zh-tw|{{{1|}}}}}| }}<includeonly>{{#if:{{Languages/Lang|af|{{{1|}}}| }}{{Languages/Lang|ar|{{{1|}}}| }}{{Languages/Lang|ast|{{{1|}}}| }}{{Languages/Lang|az|{{{1|}}}| }}{{Languages/Lang|bcc|{{{1|}}}| }}{{Languages/Lang|be|{{{1|}}}| }}{{Languages/Lang|be-tarask|{{{1|}}}| }}{{Languages/Lang|bg|{{{1|}}}| }}{{Languages/Lang|br|{{{1|}}}| }}{{Languages/Lang|bn|{{{1|}}}| }}{{Languages/Lang|bs|{{{1|}}}| }}{{Languages/Lang|ca|{{{1|}}}| }}{{Languages/Lang|cs|{{{1|}}}| }}{{Languages/Lang|da|{{{1|}}}| }}{{Languages/Lang|de|{{{1|}}}| }}{{Languages/Lang|diq|{{{1|}}}| }}{{Languages/Lang|el|{{{1|}}}| }}{{Languages/Lang|eo|{{{1|}}}| }}{{Languages/Lang|es|{{{1|}}}| }}{{Languages/Lang|fa|{{{1|}}}| }}{{Languages/Lang|fi|{{{1|}}}| }}{{Languages/Lang|fr|{{{1|}}}| }}{{Languages/Lang|gl|{{{1|}}}| }}{{Languages/Lang|gu|{{{1|}}}| }}{{Languages/Lang|he|{{{1|}}}| }}{{Languages/Lang|hi|{{{1|}}}| }}{{Languages/Lang|hr|{{{1|}}}| }}{{Languages/Lang|hu|{{{1|}}}| }}{{Languages/Lang|hy|{{{1|}}}| }}{{Languages/Lang|id|{{{1|}}}| }}{{Languages/Lang|io|{{{1|}}}| }}{{Languages/Lang|it|{{{1|}}}| }}{{Languages/Lang|ja|{{{1|}}}| }}{{Languages/Lang|jv|{{{1|}}}| }}{{Languages/Lang|ka|{{{1|}}}| }}{{Languages/Lang|kk|{{{1|}}}| }}{{Languages/Lang|km|{{{1|}}}| }}{{Languages/Lang|ko|{{{1|}}}| }}{{Languages/Lang|ko-kp|{{{1|}}}| }}{{Languages/Lang|ksh|{{{1|}}}| }}{{Languages/Lang|kw|{{{1|}}}| }}{{Languages/Lang|la|{{{1|}}}| }}{{Languages/Lang|map-bms|{{{1|}}}| }}{{Languages/Lang|min|{{{1|}}}| }}{{Languages/Lang|mk|{{{1|}}}| }}{{Languages/Lang|ml|{{{1|}}}| }}{{Languages/Lang|mr|{{{1|}}}| }}{{Languages/Lang|ms|{{{1|}}}| }}{{Languages/Lang|mwl|{{{1|}}}| }}{{Languages/Lang|nl|{{{1|}}}| }}{{Languages/Lang|no|{{{1|}}}| }}{{Languages/Lang|oc|{{{1|}}}| }}{{Languages/Lang|or|{{{1|}}}| }}{{Languages/Lang|pl|{{{1|}}}| }}{{Languages/Lang|pt|{{{1|}}}| }}{{Languages/Lang|pt-br|{{{1|}}}| }}{{Languages/Lang|ro|{{{1|}}}| }}{{Languages/Lang|ru|{{{1|}}}| }}{{Languages/Lang|si|{{{1|}}}| }}{{Languages/Lang|sk|{{{1|}}}| }}{{Languages/Lang|sl|{{{1|}}}| }}{{Languages/Lang|so|{{{1|}}}| }}{{Languages/Lang|sq|{{{1|}}}| }}{{Languages/Lang|sr|{{{1|}}}| }}{{Languages/Lang|sv|{{{1|}}}| }}{{Languages/Lang|ta|{{{1|}}}| }}{{Languages/Lang|th|{{{1|}}}| }}{{Languages/Lang|tr|{{{1|}}}| }}{{Languages/Lang|uk|{{{1|}}}| }}{{Languages/Lang|vi|{{{1|}}}| }}{{Languages/Lang|yi|{{{1|}}}| }}{{Languages/Lang|yue|{{{1|}}}| }}{{Languages/Lang|zh|{{{1|}}}| }}{{Languages/Lang|zh-hans|{{{1|}}}| }}{{Languages/Lang|zh-hant|{{{1|}}}| }}{{Languages/Lang|zh-tw|{{{1|}}}}} ||[[Category:Languages pages without translations]]}}<!-- -->[[Category:Languages pages]]<!-- -->{{#ifeq:{{#translation:}}|/en||[[Category:Languages pages{{#translation:}}]]}}</includeonly><noinclude> {{ {{TNTN|documentation}} }} [[Category:Exclude in print]] </noinclude> l61t7nzy3aqbadsvtx4hvx8vkx87v0f Template:Languages/Lang 10 67 94 2018-07-24T23:50:38Z Jspidersf 30511844 Created page with "{{#ifexist: {{#if:{{{2|}}}|{{{2}}}|{{translatable}}}}/{{{1|}}} |&nbsp;• <bdi lang="{{{1|}}}">{{#if:{{{2|}}} |[[:{{{2|}}}/{{{1|}}}|{{#language:{{{1|}}}}}]] |:{{translat..." 94 wikitext text/x-wiki {{#ifexist: {{#if:{{{2|}}}|{{{2}}}|{{translatable}}}}/{{{1|}}} |&nbsp;• <bdi lang="{{{1|}}}">{{#if:{{{2|}}} |[[:{{{2|}}}/{{{1|}}}|{{#language:{{{1|}}}}}]] |[[:{{translatable}}/{{{1|}}}|{{#language:{{{1|}}}}}]] }}</bdi> }}<noinclude> {{Documentation}} </noinclude> kwm4pwmqsn7r012ot1pk8qtorlre5kr Template:Languages/Title 10 68 95 2018-07-24T23:50:55Z Jspidersf 30511844 Created page with "{{LangSwitch|lang={{{1|}}} |default={{int:tpt-languages-legend{{#if:{{{1|}}}|/{{{1}}} }} }} |aln=Gjuha: |am=ቋምቋ፦ |an=Idioma: |ang=Sprǣc: |ar=:اللغة |arc=ܠܫܢܐ..." 95 wikitext text/x-wiki {{LangSwitch|lang={{{1|}}} |default={{int:tpt-languages-legend{{#if:{{{1|}}}|/{{{1}}} }} }} |aln=Gjuha: |am=ቋምቋ፦ |an=Idioma: |ang=Sprǣc: |ar=:اللغة |arc=ܠܫܢܐ: |arn=Dungun: |arz=:اللغة |avk=Ava: |ay=Aru: |az=Dil: |bat-smg=Kalba: |bcc=زبان: |bcl=Tataramon: |cdo=Ngṳ̄-ngiòng: |ceb=Pinulongan: |ch=Lengguahe: |ckb-arab=زمان: |co=Lingua : |crh-cyrl=Тиль: |crh-latn=Til: |cu=ѩꙁꙑ́къ : |cv=Чĕлхе: |ext=Palra: |fa=زبان: |fo=Mál: |frc=Langue : |fy=Taal: |ga=Teanga: |gag=Dil: |gan-hans=语言: |gan-hant=語言: |gn=Ñe'ẽ: |got=Razda: |grc=Γλῶσσα: |gu=ભાષા: |gv=Çhengey: |hak=Ngî-ngièn: |haw=Kou 'ōlelo: |he=שפה: |hi=भाषा: |hif-latn=Bhasa: |hy=Լեզու. |ie=Lingue: |ilo=Lengguahe: |ja=言語: |ka=ენა: |kaa=Til: |kg=Ndinga: |kiu=Zon: |kk-arab=:ٴتىل |kk-latn=Til: |km=ភាសា៖ |kn=ಭಾಷೆ: |kv=Кыв: |kw=Yeth: |la=Lingua: |li=Taol: |lij=Lengoa: |loz=Zwa Siselect: |lzh=語: |mdf=Кяль: |mg=fiteny: |mhr=Йылме: |ml=ഭാഷ: |mn=Хэл: |mwl=Lhéngua: |my=ဘာသာ: |nah=Tlahtōlli: |nap=Lengua: |nds=Spraak: |nds-nl=Taal: |ne=भाषा: |new=भाषा: |nso=Polelo: |os=Æвзаг: |pa=ਭਾਸ਼ਾ: |pam=Amanu: |pdt=Sproak: |pnb=بولی: |pnt=Γλώσσαν: |prg=Bilā: |ps=ژبه: |qu=Rimay: |sa=भाषा: |sah=Омугун тыла: |sc=Limba: |sdc=Linga: |se=Giella: |sei=Itom: |shi=tutlayt: |si=භාෂාව: |sli=Sproache: |so=Luqada: |sq=Gjuha: |srn=Tongo: |ss=Lúlwîmi: |stq=Sproake: |su=Basa: |szl=Godka: |ta=மொழி: |te=భాష: |tet=Lian: |tg-cyrl=Забон: |th=ภาษา: |ti=ቋንቋ: |tk=Dil: |to=Lea: |tyv=Дыл: |ug-latn=Til: |vec=Lengua: |vro=Kiil: |wa=Lingaedje: |war=Yinaknan: |wo=Làkk: |wuu=语言: |xal=Келн: |xh=Ulwimi: |xmf=ნინა: |yo=Èdè: |yue=語言: |zea=Taele: |zu=Ulimi: }}<noinclude>{{Documentation}}</noinclude> ocabsb70aog133r5eri7u0psxya3lyl Template:Ll 10 69 96 2018-07-24T23:51:14Z Jspidersf 30511844 Redirected page to [[Template:Localized link]] 96 wikitext text/x-wiki #REDIRECT [[Template:Localized link]] qmnhyglpbw33o7ge1i1x624h663kt7h Template:Localized link 10 70 97 2018-07-24T23:52:46Z Jspidersf 30511844 Created page with "{{#ifeq:{{FULLPAGENAME:{{{1}}}}}|{{FULLPAGENAME:{{translatable}}}}<!--self link (including translation pages)--> |<b> }}Special:MyLanguage/{{{1}}}|{{{2|{{#ifexist:Translat..." 97 wikitext text/x-wiki {{#ifeq:{{FULLPAGENAME:{{{1}}}}}|{{FULLPAGENAME:{{translatable}}}}<!--self link (including translation pages)--> |<b> }}[[Special:MyLanguage/{{{1}}}|{{{2|{{#ifexist:Translations:{{{1}}}/Page display title/en |{{#if:{{{nsp|}}} |{{PAGENAME:{{ {{TNTN|Translations:{{{1}}}/Page_display_title}} }} }} |{{ {{TNTN|Translations:{{{1}}}/Page_display_title}} }} }}|{{#if:{{{nsp|}}} |{{PAGENAME:{{{1}}}}} |{{{1}}} }} }}}}}]]{{#ifeq:{{FULLPAGENAME:{{{1}}}}}|{{FULLPAGENAME:{{translatable}}}}<!--self link (including translation pages)--> |</b> }}<span style="display:none">{{#ifexist:{{{1}}}|[[:{{{1}}}]]}}</span><noinclude> {{ {{TNTN|documentation}} }} </noinclude> n2pdxgzygayip1l203lar5ugurlimq6 Template:MainTemplate 10 9 18 14 2009-07-08T08:41:15Z MediaWiki default 30443056 18 wikitext text/x-wiki {{HeaderTemplate|welcome={{{welcome}}}|blurb={{{blurb}}}}} <br /> <!-- LEFT COLUMN --> {| width="100%" cellspacing="0" cellpadding="0" style="background:transparent;" |- | width="50%" style="vertical-align:top; padding-right:0.5em;" | <!-- Info about this site --> {{SectionTemplate|title={{{about_title}}}|content={{{about_content}}}}} | width="50%" style="vertical-align:top; padding-left:0.5em;" | <!-- Featured Article --> {{SectionTemplate|title={{{featured_title}}}|content={{{featured_content}}}}} |} <br /> <!-- RIGHT COLUMN --> {| width="100%" cellspacing="0" cellpadding="0" style="background:transparent;" |- | width="50%" style="vertical-align:top; padding-right:0.5em;" | <!-- Did you know... --> {{SectionTemplate|title={{{didyouknow_title}}}|content={{{didyouknow_content}}}}} | width="50%" style="vertical-align:top; padding-left:0.5em;" | <!-- Site news --> {{SectionTemplate|title={{{news_title}}}|content={{{news_content}}}}} |} __NOTOC__ __NOEDITSECTION__ e4p99tjrg6tq47iqlh9ln9ua3v35z2z Template:Nmbox 10 71 98 2018-07-24T23:53:01Z Jspidersf 30511844 Created page with "<table class="nmbox" style="border:1px solid #AAA; border-collapse:collapse; clear:both; font-size:85%; margin: 0.5em 0"> <tr style="background:#EEF3E2"> {{#if:{{{image|}}}{{{..." 98 wikitext text/x-wiki <table class="nmbox" style="border:1px solid #AAA; border-collapse:collapse; clear:both; font-size:85%; margin: 0.5em 0"> <tr style="background:#EEF3E2"> {{#if:{{{image|}}}{{{header|}}} | <th class="mbox-image" style="white-space:nowrap; padding:4px 1em; border-{{dir|{{pagelang}}|left|right}}:1px solid #aaa">{{{image|}}} {{{header|}}}</th> | <td class="mbox-empty-cell"></td> <!-- No image. Cell with some width or padding necessary for text cell to have 100% width. --> }} <td class="mbox-text" style="background:#F6F9ED">{{{text|}}}</td> </tr></table><noinclude> {{documentation}} </noinclude> 7a6smrv7mtvkpwcms1petde2nt653ex Template:Pagelang 10 38 65 2018-07-24T23:30:21Z Jspidersf 30511844 Created page with "{{#ifeq:{{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}|{{#titleparts:{{{1|{{PAGENAME}}}}}|1}}||{{#ifeq:{{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}|{{lc:{{PAGENAME:{{#titleparts:{{{1|{{..." 65 wikitext text/x-wiki {{#ifeq:{{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}|{{#titleparts:{{{1|{{PAGENAME}}}}}|1}}||{{#ifeq:{{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}|{{lc:{{PAGENAME:{{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}}}}}|{{#ifeq:{{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}|{{urlencode:{{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}}}|{{#ifeq:{{lc:{{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}}}|{{ucfirst:{{lc:{{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}}}}}||{{#switch:{{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}|doc|layout|sandbox|testcases|init|preload=|#default={{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}}}}}}}}}}}<noinclude>{{Documentation}}</noinclude> acqhx2nttfjqv7brml1d0t4avs3kjsp Template:Pp-meta 10 61 88 2018-07-24T23:46:12Z Jspidersf 30511844 Created page with "<noinclude> {{languages}} </noinclude>{{#ifeq:{{#switch:{{lc:{{{type}}}}} |move=<!-- -->{{#ifeq: {{#switch:{{lc:{{{demolevel|undefined}}}}} |semi |autoconfirm..." 88 wikitext text/x-wiki <noinclude> {{languages}} </noinclude>{{#ifeq:{{#switch:{{lc:{{{type}}}}} |move=<!-- -->{{#ifeq: {{#switch:{{lc:{{{demolevel|undefined}}}}} |semi |autoconfirmed = autoconfirmed |administrator |full |sysop = sysop |undefined = {{PROTECTIONLEVEL:move}} |#default = <!--fallback value: null -->}} |sysop|yes|no }} |create=<!-- -->{{#if: {{#switch:{{lc:{{{demolevel|undefined}}}}} |semi |autoconfirmed = autoconfirmed |administrator |full |sysop = sysop |undefined = {{PROTECTIONLEVEL:create}} |#default = <!--fallback value: null -->}} |yes|no }} |template=<!-- -->{{#if: {{#switch:{{lc:{{{demolevel|undefined}}}}} |templateeditor |template = templateeditor |administrator |full |sysop = sysop |undefined = {{PROTECTIONLEVEL:edit}} |#default = <!--fallback value: null -->}} |yes|no }} |pc1 =<!-- -->{{#ifeq: {{#switch:{{lc:{{{demolevel|undefined}}}}} |pc1 = autoconfirmed <!-- this is the value that the PENDINGCHANGELEVEL magic word returns for pc1 --> |undefined = {{PENDINGCHANGELEVEL}} |#default = <!--fallback value: null -->}} |autoconfirmed |yes|no }} |pc2 =<!-- -->{{#ifeq: {{#switch:{{lc:{{{demolevel|undefined}}}}} |pc2 = review <!-- this is the value that the PENDINGCHANGELEVEL magic word returns for pc2 --> |undefined = {{PENDINGCHANGELEVEL}} |#default = <!--fallback value: null -->}} |review |yes|no }} |#default<!--includes all other types-->=<!-- -->{{#if: {{#switch:{{lc:{{{demolevel|undefined}}}}} |semi |autoconfirmed = autoconfirmed |administrator |full |sysop = sysop |undefined = {{PROTECTIONLEVEL:edit}} |#default = <!--fallback value: null -->}} |{{#ifeq:{{#switch:{{lc:{{{disallowlevel|}}}}} |semi |autoconfirmed = autoconfirmed |administrator |full |sysop = sysop |#default = <!--fallback value: null-->}} |{{#switch:{{lc:{{{demolevel|undefined}}}}} |semi |autoconfirmed = autoconfirmed |administrator |full |sysop = sysop |undefined = {{PROTECTIONLEVEL:edit}} |#default = <!--fallback value: null -->}} |no|yes }} |no}} }}|yes|{{#ifeq:{{lc:{{{small|}}}}}|yes| <div class="metadata topicon nopopups" id="protected-icon" style="display:none; right:{{#if:{{{right|}}}|{{{right}}}|55px}};">[[Image:{{{image|{{#switch:{{lc:{{{type}}}}} |full=Padlock.svg |semi=Padlock-silver.svg |template=Padlock-pink.svg |pc1=Padlock-silver-light.svg |pc2=Padlock-orange.svg |move=Padlock-olive.svg |indef=Padlock-red.svg |office=Padlock-black.svg |create=Padlock-skyblue.svg |#default=Transparent.gif }}}}}|20px|link={{{icon-link|Wikipedia:Protection policy#{{lc:{{{type}}}}}}}}|{{{icon-text|{{#switch:{{lc:{{{type}}}}} |pc1 = All edits by unregistered and new users are subject to review |pc2 = All edits by users who are not reviewers or administrators are subject to review |template = This is a permanently protected {{pp-meta/pagetype}} |#default = This {{pp-meta/pagetype}} is {{#switch:{{lc:{{{type}}}}} |semi=semi- |move=move- |indef=permanently<nowiki> </nowiki> |create=creation- |office=<!--null, but should this have a special tag?--> |full |#default=<!--null--> }}protected }}{{#ifeq:{{lc:{{{type}}}}}|indef||{{#if:{{{expiry|}}}|<nowiki> </nowiki>until {{#time:F j, Y|{{{expiry}}}}}{{#if:{{{icon-reason|}}}|,}}}}}}{{#if:{{{icon-reason|}}}|<nowiki> </nowiki>{{{icon-reason}}}}}.}}}|alt={{#ifeq:{{lc:{{{type}}}}}|template |{{#switch:{{NAMESPACENUMBER}} |10|828=Permanently protected {{pp-meta/pagetype}} |#default=Page permanently protected }} |Page {{#switch:{{lc:{{{type}}}}} |pc1=protected with pending changes level 1 |pc2=protected with pending changes level 2 |semi=semi-protected |move=move-protected |indef=permanently protected |create=creation-protected |office=<!--null, but should this have a special tag?--> |full |#default=protected }} }}]]</div> |<!-- else, not small --> {{mbox | name = {{{name|Pp-meta}}} | subst = {{{subst|}}} | demospace = {{{demospace|}}} | type = protection | image = [[Image:{{{image|{{#switch:{{lc:{{{type}}}}} |full=Padlock.svg |semi=Padlock-silver.svg |pc1=Padlock-silver-light.svg |pc2=Padlock-orange.svg |move=Padlock-olive.svg |template=Padlock-pink.svg |indef=Padlock-red.svg |office=Padlock-black.svg |create=Padlock-skyblue.svg |#default=Transparent.gif }}}}}|40px|{{{icon-text|{{#ifeq:{{lc:{{{type}}}}}|template |{{#switch:{{NAMESPACENUMBER}} |10|828=This is a permanently protected {{pp-meta/pagetype}} |#default=This page is permanently protected }} |This page is {{#switch:{{lc:{{{type}}}}} |pc1=protected with pending changes level 1 |pc2=protected with pending changes level 2 |semi=semi-protected |move=move-protected |indef=permanently protected |create=creation-protected |office=protected<!--should this have a special tag?--> |full |#default=protected }} }}.}}}]] | text = '''{{{reason-text|{{#switch:{{lc:{{{type}}}}} |full=This {{pp-meta/pagetype}} is currently [[Help:Protection|protected]] from editing |semi=Editing of this {{pp-meta/pagetype}} by [[Wikipedia:User access levels#New users|new]] or [[Wikipedia:User access levels#Unregistered users|unregistered]] users is currently [[Help:Protection|disabled]] |pc1=All edits made to this {{pp-meta/pagetype}} by [[Wikipedia:User access levels#New users|new]] or [[Wikipedia:User access levels#Unregistered users|unregistered]] users are currently [[Wikipedia:Pending changes|subject to review]] |pc2=All edits made to this {{pp-meta/pagetype}} by users who are not [[Wikipedia:Reviewing|reviewers]] or [[Wikipedia:Administrators|administrators]] are currently [[Wikipedia:Pending changes|subject to review]] |move=This {{pp-meta/pagetype}} is currently [[Help:Protection|protected]] from [[Help:Moving a page|page moves]] |template=This is a permanently [[Help:Protection|protected]] {{pp-meta/pagetype}}, as it is [[Wikipedia:High-risk templates|high-risk]] |indef=This page is [[Help:Protection|protected]] from editing ''indefinitely'' |office=This {{pp-meta/pagetype}} is currently [[Help:Protection|protected]] from editing |create=[[Help:Starting a new page|Recreation]] of this {{pp-meta/pagetype}} [[Help:Protection|has been disabled]] }}{{#ifeq:{{lc:{{{type}}}}}|indef||{{#if:{{{expiry|}}}|&#32;until {{#time:F j, Y|{{{expiry}}}}}{{#if:{{{reason|}}}|,}}}}}}{{{reason<includeonly>|</includeonly>}}}.}}}'''<br /> {{{explanation-text|{{#ifeq:{{lc:{{{dispute}}}}}|yes|This protection is '''not''' an endorsement of the {{#ifeq:{{{type}}}|move|[{{fullurl:Special:Log|type=move&page={{FULLPAGENAMEE}}}} current title]|[{{fullurl:{{FULLPAGENAMEE}}|action=history}} current version]}}.}} See the [[Wikipedia:Protection policy|protection policy]] and [{{fullurl:Special:Log|type={{#switch:{{lc:{{{type}}}}} | pc1 | pc2 = stable | #default = protect }}&page={{FULLPAGENAMEE}}}} {{#switch:{{lc:{{{type}}}}} | pc1 | pc2 = pending changes | #default = protection }} log] for more details. {{#switch:{{lc:{{{type}}}}} |full|indef=Please discuss any changes on the [[{{TALKPAGENAME}}#{{#if:{{{section|}}}|{{{section}}}|top}}|talk page]]; you may {{Submit an edit request/link|display=submit a request}} to ask an [[Wikipedia:Administrators|administrator]] to make an edit if it is [[Help:Minor edit#When to mark an edit as a minor edit|uncontroversial]] or supported by [[Wikipedia:Consensus|consensus]]. {{#ifeq:{{NAMESPACE}}|{{ns:8}}<!--MediaWiki-->||You may also [[Wikipedia:Requests for page protection#Current requests for reduction in protection level|request]] that this page be unprotected.}} |semi=If you cannot edit this {{pp-meta/pagetype}} and you wish to make a change, you can {{#ifeq:{{NAMESPACE}}|{{TALKSPACE}}||{{submit an edit request/link|type=semi|display=request an edit}}, [[{{TALKPAGENAME}}|discuss changes on the talk page]],}} [[Wikipedia:Requests for page protection#Current requests for reduction in protection level|request unprotection]], [[Special:Userlogin|log in]], or [[Special:UserLogin/signup|create an account]]. |move=The page may still be edited but cannot be moved until unprotected. Please discuss any suggested moves on the [[{{TALKPAGENAME}}|talk page]] or at [[Wikipedia:Requested moves]]. You can also [[Wikipedia:Requests for page protection|request]] that the page be unprotected. |template=Please discuss any changes on the [[{{TALKPAGENAME}}#{{#if:{{{section|}}}|{{{section}}}|top}}|talk page]]; you may {{Submit an edit request/link|type=template|display=submit a request}} to ask an [[Wikipedia:Administrators|administrator]] or [[Wikipedia:Template editor|template editor]] to make an edit if it is [[Help:Minor edit#When to mark an edit as a minor edit|uncontroversial]] or supported by [[Wikipedia:Consensus|consensus]]. {{#ifeq:{{NAMESPACE}}|{{ns:8}}<!--MediaWiki-->||You may also [[Wikipedia:Requests for page protection|request]] that this page be unprotected.}} |office=If you can edit this page, please discuss all changes and additions on the [[{{TALKPAGENAME}}|talk page]] first. '''Do not remove protection from this page unless you are authorized by the Wikimedia Foundation to do so.''' |create=Please see the {{#if:{{{xfd|}}}|'''[[{{{xfd}}}|deletion discussion]]''' or the}} [{{fullurl:Special:Log|type=delete&page={{FULLPAGENAMEE}}}} deletion log] for details of why this page was deleted. If you would like to create a page at this title, you must first [[Wikipedia:Requests for page protection|request]] for it to be unprotected, or contact the administrator who deleted the page for the deleted material to be restored. If unsuccessful, you can use [[Wikipedia:Deletion review|deletion review]]. }}}}} }} }}|{{#ifeq:{{FULLPAGENAME}}|Template:Pp-meta|<!--nothing-->|[[Category:Wikipedia pages with incorrect protection templates]]}}}}<!--End if small--><includeonly>{{#ifeq:{{PROTECTIONLEVEL:edit}}{{lc:{{{demolevel|undefined}}}}}|templateeditorundefined|{{#switch:{{NAMESPACE}}|Template|Module=|[[Category:Wikipedia template-protected pages other than templates and modules]]}}}}{{#ifeq:{{lc:{{{categories|no}}}}}|no||{{{categories|}}}}}</includeonly><noinclude> {{ {{TNTN|documentation}} }} [[Category:Protection templates{{#translation:}}|*]] [[Category:Title templates{{#translation:}}|Pp-meta]] [[Category:Wikipedia metatemplates{{#translation:}}|Pp-meta]] [[Category:Exclude in print{{#translation:}}|{{PAGENAME}}]] </noinclude> bjy2jk6uuphdbpog4rs4caqxvv6bcol Template:Pp-meta/pagetype 10 62 89 2018-07-24T23:46:46Z Jspidersf 30511844 Created page with "{{#ifeq:{{TALKSPACE}}|{{NAMESPACE}}|talk page| {{#switch:{{NAMESPACE}} |{{ns:}} = article |{{ns:File}} = file |{{ns:Template}} = template |{{ns:..." 89 wikitext text/x-wiki {{#ifeq:{{TALKSPACE}}|{{NAMESPACE}}|talk page| {{#switch:{{NAMESPACE}} |{{ns:}} = article |{{ns:File}} = file |{{ns:Template}} = template |{{ns:Category}} = category |{{ns:Module}} = module |#default = page}}}}<noinclude> {{doc|content={{NODOC}}}} </noinclude> pttdhb8ryrm4klhkfpi1swcyzsmrqxb Template:Pp-template 10 63 90 2018-07-24T23:47:13Z Jspidersf 30511844 Created page with "<includeonly>{{pp-meta |type={{#switch:{{{demolevel|{{#ifeq:{{PROTECTIONLEVEL:edit}}-{{PROTECTIONLEVEL:move}}|-sysop|move|{{PROTECTIONLEVEL:edit}}}}}}} |semi |autoconfir..." 90 wikitext text/x-wiki <includeonly>{{pp-meta |type={{#switch:{{{demolevel|{{#ifeq:{{PROTECTIONLEVEL:edit}}-{{PROTECTIONLEVEL:move}}|-sysop|move|{{PROTECTIONLEVEL:edit}}}}}}} |semi |autoconfirmed=semi |administrator |full |sysop=indef |move=move |templateeditor=template |#default=template<!--fallback value-->}} |small={{{small|yes}}} |right={{{right|}}} |demospace={{{demospace|}}} |demolevel={{#ifeq:{{PAGENAME}}/{{NAMESPACE}}|{{SUBPAGENAME}}/{{ns:Template}}|{{{demolevel|undefined}}}|{{#ifeq:{{lc:{{SUBPAGENAME}}}}|sandbox|sysop|{{{demolevel|undefined}}}}}}} |expiry=<!--not applicable--> |dispute=no |icon-text=This {{#ifeq:{{NAMESPACE}}|{{ns:6}}|image, included in a high-risk template or message,|high-risk {{pp-meta/pagetype}} }} is permanently {{#switch:{{{demolevel|{{#ifeq:{{PROTECTIONLEVEL:edit}}-{{PROTECTIONLEVEL:move}}|-sysop|move|{{PROTECTIONLEVEL:edit}}}}}}} |semi |autoconfirmed=semi-protected from editing |move=move-protected |administrator |full |sysop |templateeditor |#default=<!--fallback value--> protected from editing}} to prevent vandalism. |reason-text=This {{#switch:{{NAMESPACE}} |{{ns:image}}=image, used in one or more [[Wikipedia:High-risk templates|high-risk templates]]{{#switch:{{{demolevel|{{PROTECTIONLEVEL:edit}}}}} |semi |autoconfirmed= |administrator |full |sysop=<nowiki> </nowiki>and/or [[Special:Allmessages|system messages]], |templateeditor=<nowiki> </nowiki>and/or [[Special:Allmessages|system messages]], |#default=<!--fallback value-->}} |#default=[[Wikipedia:High-risk templates|high-risk {{pp-meta/pagetype}}]] }} has been [[Wikipedia:This page is protected|{{#switch:{{{demolevel|{{#ifeq:{{PROTECTIONLEVEL:edit}}-{{PROTECTIONLEVEL:move}}|-sysop|move|{{PROTECTIONLEVEL:edit}}}}}}} |semi |autoconfirmed=semi- |move=move- |administrator |full |sysop |templateeditor<!--uses default--> |#default=<!--fallback value-->permanently<nowiki> </nowiki>}}protected]]{{#ifeq:{{PROTECTIONLEVEL:edit}}-{{PROTECTIONLEVEL:move}}|-sysop||<nowiki> </nowiki>from editing}} to prevent [[Wikipedia:Vandalism|vandalism]]. {{#switch:{{{demolevel|{{PROTECTIONLEVEL:edit}}}}} |semi |autoconfirmed= |administrator |full |sysop |templateeditor<!--uses default--> |#default={{#switch:{{NAMESPACE}}|{{ns:image}}=<br /><small>'''Do not move this image''' to [[commons:|Wikimedia Commons]].</small>}}}} |categories={{{categories|{{#ifeq:{{NAMESPACE}}|{{ns:10}}|{{#switch:{{{demolevel|{{#ifeq:{{PROTECTIONLEVEL:edit}}-{{PROTECTIONLEVEL:move}}|-sysop|move|{{PROTECTIONLEVEL:edit}}}}}}} |semi |autoconfirmed=[[Category:Wikipedia semi-protected templates|{{PAGENAME}}]]{{#ifeq:{{PROTECTIONLEVEL:move}}|sysop|[[Category:Wikipedia move-protected templates|{{PAGENAME}}]]}} |move=[[Category:Wikipedia move-protected templates|{{PAGENAME}}]] |administrator |full |sysop |templateeditor<!--uses default--> |#default=[[Category:Wikipedia protected templates|{{PAGENAME}}]]<!--fallback value-->}}}}{{#ifeq:{{NAMESPACE}}|{{ns:6}}|[[Category:{{#switch:{{{demolevel|{{PROTECTIONLEVEL:edit}}}}} |semi |autoconfirmed=Semi-protected |administrator |full |sysop |templateeditor<!--uses default--> |#default=Protected<!--fallback value-->}} images|{{PAGENAME}}]]}}}}}}}</includeonly><noinclude> {{pp-template|categories=no}} <!-- Show the small version --> {{pp-template|small=no}} <!-- Show the large version --> {{Documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> 0f32k8jn0m1rwbfgys15odtk95eusit Template:SectionTemplate 10 8 20 13 2009-07-12T21:34:10Z MediaWiki default 30443056 20 wikitext text/x-wiki <h2 style="border:none; background-color:#4682B4; padding:0.2em 0; margin:0; color:#ffffff; font-size:125%; font-weight:bold; text-indent:0.5em; font-variant:small-caps; -moz-border-radius: 10px">{{{title}}}</h2> <div style="margin-bottom:1em; padding:0.5em 0.8em 0.5em 0.8em;"> {{{content}}} </div> j5b1lar8shlr44bgt4p6ns6h3e72b0p Template:TNTN 10 39 66 2018-07-24T23:30:47Z Jspidersf 30511844 Redirected page to [[Template:Translatable template name]] 66 wikitext text/x-wiki #REDIRECT [[Template:Translatable template name]] 9jfv2d1bbhmny4vmo6i4tz4duamjveq Template:Tim 10 72 99 2018-07-24T23:54:09Z Jspidersf 30511844 Created page with "[[m:Template:{{{1|{{PAGENAME}}}}}]]<noinclude> {{documentation|content= Displays a link to a template on Meta. * {{xpds|tim|foo}} [[Category:Shortcut templates|{{PAGENAME}}]]..." 99 wikitext text/x-wiki [[m:Template:{{{1|{{PAGENAME}}}}}]]<noinclude> {{documentation|content= Displays a link to a template on Meta. * {{xpds|tim|foo}} [[Category:Shortcut templates|{{PAGENAME}}]] [[Category:External link templates]]}}</noinclude> 54ptev4fx3n4s218vxn2rd4y2owuqod Template:Tip 10 78 127 118 2018-07-30T19:13:41Z Jspidersf 30511844 127 wikitext text/x-wiki <blockquote style="background-color: #ddf5eb; border: none;"> {| | [[File:Lightbulb.png|left|bottom]] | {{{1}}} |} </blockquote> 0s0l7ghbdjwc7z6tr32zsmjy0upldp0 Template:Tiw 10 73 100 2018-07-24T23:54:25Z Jspidersf 30511844 Created page with "[[w:Template:{{{1|{{PAGENAME}}}}}]]<noinclude> ---- Displays a link to a template on the English Wikipedia. * {{xpd|tiw|foo}} [[Category:Shortcut templates|{{PAGENAME}}]] C..." 100 wikitext text/x-wiki [[w:Template:{{{1|{{PAGENAME}}}}}]]<noinclude> ---- Displays a link to a template on the English Wikipedia. * {{xpd|tiw|foo}} [[Category:Shortcut templates|{{PAGENAME}}]] [[Category:External link templates]]</noinclude> dysg482015h1dswv9s5ybu48jtsk6l6 Template:Translatable 10 74 101 2018-07-24T23:54:47Z Jspidersf 30511844 Created page with "{{#ifeq:{{pagelang|{{{1|{{FULLPAGENAME}}}}}}}| |{{{1|{{FULLPAGENAME}}}}} |{{#invoke:String|sub|{{{1|{{FULLPAGENAME}}}}} |1 |{{#expr:{{#invoke:String|len|{{{1|{{FULLPAGENAM..." 101 wikitext text/x-wiki {{#ifeq:{{pagelang|{{{1|{{FULLPAGENAME}}}}}}}| |{{{1|{{FULLPAGENAME}}}}} |{{#invoke:String|sub|{{{1|{{FULLPAGENAME}}}}} |1 |{{#expr:{{#invoke:String|len|{{{1|{{FULLPAGENAME}}}}}}}-{{#invoke:String|len|{{pagelang|{{{1|{{FULLPAGENAME}}}}}}}}}-1}} }} }}<noinclude> {{ {{TNTN|Documentation}} |content= == Examples == * <code><nowiki>{{translatable}}</nowiki></code> {{translatable}} * <code><nowiki>{{translatable|Page name}}</nowiki></code> {{translatable|Page name}} * <code><nowiki>{{translatable|Page name/ja}}</nowiki></code> {{translatable|Page name/ja}} }} [[Category:Internationalization templates{{#translation:}}]] </noinclude> 3azv7v0c2ey3qixhczhrqr15p9fbofu Template:Translatable template name 10 40 67 2018-07-24T23:31:37Z Jspidersf 30511844 Created page with "<includeonly>{{#invoke:Template translation{{{sandbox|}}}|getTranslatedTemplate|uselang={{{uselang|}}}|tntns={{{tntns|{{{namespace|}}}}}}|template={{#if:{{{noshift|}}}|{{{temp..." 67 wikitext text/x-wiki <includeonly>{{#invoke:Template translation{{{sandbox|}}}|getTranslatedTemplate|uselang={{{uselang|}}}|tntns={{{tntns|{{{namespace|}}}}}}|template={{#if:{{{noshift|}}}|{{{template}}}|{{{1}}}}}|noshift={{{noshift|}}}<!-- there are no other parameters here -->}}</includeonly><noinclude>{{documentation}}</noinclude> o6i6fg0zjvh6t1i5ssv2lyj9eb8oeqs Template:Translatable template name/doc 10 58 85 2018-07-24T23:42:22Z Jspidersf 30511844 Created page with "<noinclude>{{Documentation subpage}}</noinclude> {{ {{TNTN|Shortcut}} |Template:TNTN|Template:tntn}} == Purpose == This template is used to return the name of translatable te..." 85 wikitext text/x-wiki <noinclude>{{Documentation subpage}}</noinclude> {{ {{TNTN|Shortcut}} |Template:TNTN|Template:tntn}} == Purpose == This template is used to return the name of translatable templates in the language of the current page. Templates, like all other MediaWiki pages, can be translated using the [[mw:Extension:Translate|Translate extension]], which creates subpages with the form "pagename/language code". The template first checks if the name of the page contains a language code. If it does, it then checks if the template name given as a first parameter has a translation in that language. If the page name does not contain a language code, or if the navigation template doesn't exist in that language, it will display the English template. == How to use == * <code><nowiki>{{ {{Translatable template name|</nowiki>''name of navigation template''<nowiki>}}|</nowiki>''parameters....''<nowiki>}}</nowiki></code> * <code><nowiki>{{ {{TNTN|</nowiki>''name of navigation template''<nowiki>}}|</nowiki>''parameters....<nowiki>}}</nowiki></code> * <code><nowiki>{{ {{tntn|</nowiki>''name of navigation template''<nowiki>}}|</nowiki>''parameters....<nowiki>}}</nowiki></code> Example (from translatable [[meta:Template:Meta]], used in translatable page [[meta:Meta:About]]): : <code><nowiki>{{Translatable template name|Tnavbar}}</nowiki></code> or <code><nowiki>{{TNTN|Tnavbar}}</nowiki></code> which returns the translated versions of {{tl|Tnavbar}} if it exists, or the English version if translations don't exist. == Parameters == The current version of the template may now include any kind of named or numbered parameters, whose values will be transferred into the called template (with the exception of parameter 1 containing the basename of the translatable template to transclude). Numbered parameters will be shifted down by one position, all named parameters will be passed unchanged. One named parameter is treated specially: * <code><nowiki>{{Translatable template name|tntns=</nowiki>'':somename:''<nowiki>|</nowiki>''page name''<nowiki>}}</nowiki></code> * <code><nowiki>{{TNTN|tntns=</nowiki>'':somename:''<nowiki>|</nowiki>''page name''<nowiki>}}</nowiki></code> * <code><nowiki>{{tntn|tntns=</nowiki>'':somename:''<nowiki>|</nowiki>''page name''<nowiki>}}</nowiki></code> This <code>tntns</code> will be used to specify another namespace from which the translatable pagename will be transcluded, instead of referencing the page name from the default <code>:Template:</code> namespace. Note that this parameter is also passed (without modification) within the parameters of the transclusion. Example with one parameters (from [[meta:Meta:About]] which is translatable): * <code><nowiki>{{{{TNTN|Tnavbar}}|Meta:About}}</nowiki></code> == Dependency == * [[Module:Template translation]] (standard version) * [[meta:Module:Template translation/sandbox]] (used when this template is called with optional parameter <code>sandbox=/sandbox</code>, for testing modifications only) == See also == * {{tl|Translatable template}}, alias {{tl|TNT}} or {{tl|tnt}} <includeonly> <!-- PUT HERE THE CATEGORIES OF THE TEMPLATE --> [[Category:Navigation templates|* {{PAGENAME}}]] [[Category:Internationalization templates|{{PAGENAME}}]] [[Category:Lua-based templates]] </includeonly> 4fu95a7x8498o63eofywxqonfe3sirq Template:Uselang 10 64 91 2018-07-24T23:47:44Z Jspidersf 30511844 Created page with "{{#if: {{{lang|}}} | {{{lang|}}} | {{#ifeq: {{int:Lang}} | <Lang> | default | {{int:Lang}} }} }}<noinclude> {{ {{TNTN|Documentation}} |content= Returns the code of the user l..." 91 wikitext text/x-wiki {{#if: {{{lang|}}} | {{{lang|}}} | {{#ifeq: {{int:Lang}} | <Lang> | default | {{int:Lang}} }} }}<noinclude> {{ {{TNTN|Documentation}} |content= Returns the code of the user language, as specified in the corresponding page mediawiki:lang/xx, otherwise "en" (default). MediaWiki:Lang: {{languages|MediaWiki:Lang}} }} [[Category:Internationalization templates{{#translation:}}]] </noinclude> 3hvislgryr0prqkw6rcvgzb17w00uwi Category:Browse 14 13 24 2009-12-30T17:56:16Z MediaWiki default 30443056 24 wikitext text/x-wiki This is a starting point which can be used to access any article on this wiki. [[Category:Browse]] 5s3x2nudvhqwi71yepyzbt5ozp3acmm Category:Templates 14 12 23 2009-12-30T17:55:03Z MediaWiki default 30443056 23 wikitext text/x-wiki This category is for '''Templates'''. [[Category:Browse]] jpvy9lwat2x4w625g8zef5ao6t97drj Category:Utility templates 14 11 22 2009-12-30T17:54:25Z MediaWiki default 30443056 22 wikitext text/x-wiki This category is for '''Utility templates'''. [[Category:Templates]] 2k1og0eh9magim62rcbfxwmcn1sxnrf Module:Arguments 828 41 68 2018-07-24T23:32:05Z Jspidersf 30511844 Created page with "-- This module provides easy processing of arguments passed to Scribunto from -- #invoke. It is intended for use by other Lua modules, and should not be -- called from #invoke..." 68 Scribunto text/plain -- This module provides easy processing of arguments passed to Scribunto from -- #invoke. It is intended for use by other Lua modules, and should not be -- called from #invoke directly. local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local arguments = {} -- Generate four different tidyVal functions, so that we don't have to check the -- options every time we call it. local function tidyValDefault(key, val) if type(val) == 'string' then val = val:match('^%s*(.-)%s*$') if val == '' then return nil else return val end else return val end end local function tidyValTrimOnly(key, val) if type(val) == 'string' then return val:match('^%s*(.-)%s*$') else return val end end local function tidyValRemoveBlanksOnly(key, val) if type(val) == 'string' then if val:find('%S') then return val else return nil end else return val end end local function tidyValNoChange(key, val) return val end local function matchesTitle(given, title) local tp = type( given ) return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title end local translate_mt = { __index = function(t, k) return k end } function arguments.getArgs(frame, options) checkType('getArgs', 1, frame, 'table', true) checkType('getArgs', 2, options, 'table', true) frame = frame or {} options = options or {} --[[ -- Set up argument translation. --]] options.translate = options.translate or {} if getmetatable(options.translate) == nil then setmetatable(options.translate, translate_mt) end if options.backtranslate == nil then options.backtranslate = {} for k,v in pairs(options.translate) do options.backtranslate[v] = k end end if options.backtranslate and getmetatable(options.backtranslate) == nil then setmetatable(options.backtranslate, { __index = function(t, k) if options.translate[k] ~= k then return nil else return k end end }) end --[[ -- Get the argument tables. If we were passed a valid frame object, get the -- frame arguments (fargs) and the parent frame arguments (pargs), depending -- on the options set and on the parent frame's availability. If we weren't -- passed a valid frame object, we are being called from another Lua module -- or from the debug console, so assume that we were passed a table of args -- directly, and assign it to a new variable (luaArgs). --]] local fargs, pargs, luaArgs if type(frame.args) == 'table' and type(frame.getParent) == 'function' then if options.wrappers then --[[ -- The wrappers option makes Module:Arguments look up arguments in -- either the frame argument table or the parent argument table, but -- not both. This means that users can use either the #invoke syntax -- or a wrapper template without the loss of performance associated -- with looking arguments up in both the frame and the parent frame. -- Module:Arguments will look up arguments in the parent frame -- if it finds the parent frame's title in options.wrapper; -- otherwise it will look up arguments in the frame object passed -- to getArgs. --]] local parent = frame:getParent() if not parent then fargs = frame.args else local title = parent:getTitle():gsub('/sandbox$', '') local found = false if matchesTitle(options.wrappers, title) then found = true elseif type(options.wrappers) == 'table' then for _,v in pairs(options.wrappers) do if matchesTitle(v, title) then found = true break end end end -- We test for false specifically here so that nil (the default) acts like true. if found or options.frameOnly == false then pargs = parent.args end if not found or options.parentOnly == false then fargs = frame.args end end else -- options.wrapper isn't set, so check the other options. if not options.parentOnly then fargs = frame.args end if not options.frameOnly then local parent = frame:getParent() pargs = parent and parent.args or nil end end if options.parentFirst then fargs, pargs = pargs, fargs end else luaArgs = frame end -- Set the order of precedence of the argument tables. If the variables are -- nil, nothing will be added to the table, which is how we avoid clashes -- between the frame/parent args and the Lua args. local argTables = {fargs} argTables[#argTables + 1] = pargs argTables[#argTables + 1] = luaArgs --[[ -- Generate the tidyVal function. If it has been specified by the user, we -- use that; if not, we choose one of four functions depending on the -- options chosen. This is so that we don't have to call the options table -- every time the function is called. --]] local tidyVal = options.valueFunc if tidyVal then if type(tidyVal) ~= 'function' then error( "bad value assigned to option 'valueFunc'" .. '(function expected, got ' .. type(tidyVal) .. ')', 2 ) end elseif options.trim ~= false then if options.removeBlanks ~= false then tidyVal = tidyValDefault else tidyVal = tidyValTrimOnly end else if options.removeBlanks ~= false then tidyVal = tidyValRemoveBlanksOnly else tidyVal = tidyValNoChange end end --[[ -- Set up the args, metaArgs and nilArgs tables. args will be the one -- accessed from functions, and metaArgs will hold the actual arguments. Nil -- arguments are memoized in nilArgs, and the metatable connects all of them -- together. --]] local args, metaArgs, nilArgs, metatable = {}, {}, {}, {} setmetatable(args, metatable) local function mergeArgs(tables) --[[ -- Accepts multiple tables as input and merges their keys and values -- into one table. If a value is already present it is not overwritten; -- tables listed earlier have precedence. We are also memoizing nil -- values, which can be overwritten if they are 's' (soft). --]] for _, t in ipairs(tables) do for key, val in pairs(t) do if metaArgs[key] == nil and nilArgs[key] ~= 'h' then local tidiedVal = tidyVal(key, val) if tidiedVal == nil then nilArgs[key] = 's' else metaArgs[key] = tidiedVal end end end end end --[[ -- Define metatable behaviour. Arguments are memoized in the metaArgs table, -- and are only fetched from the argument tables once. Fetching arguments -- from the argument tables is the most resource-intensive step in this -- module, so we try and avoid it where possible. For this reason, nil -- arguments are also memoized, in the nilArgs table. Also, we keep a record -- in the metatable of when pairs and ipairs have been called, so we do not -- run pairs and ipairs on the argument tables more than once. We also do -- not run ipairs on fargs and pargs if pairs has already been run, as all -- the arguments will already have been copied over. --]] metatable.__index = function (t, key) --[[ -- Fetches an argument when the args table is indexed. First we check -- to see if the value is memoized, and if not we try and fetch it from -- the argument tables. When we check memoization, we need to check -- metaArgs before nilArgs, as both can be non-nil at the same time. -- If the argument is not present in metaArgs, we also check whether -- pairs has been run yet. If pairs has already been run, we return nil. -- This is because all the arguments will have already been copied into -- metaArgs by the mergeArgs function, meaning that any other arguments -- must be nil. --]] if type(key) == 'string' then key = options.translate[key] end local val = metaArgs[key] if val ~= nil then return val elseif metatable.donePairs or nilArgs[key] then return nil end for _, argTable in ipairs(argTables) do local argTableVal = tidyVal(key, argTable[key]) if argTableVal ~= nil then metaArgs[key] = argTableVal return argTableVal end end nilArgs[key] = 'h' return nil end metatable.__newindex = function (t, key, val) -- This function is called when a module tries to add a new value to the -- args table, or tries to change an existing value. if type(key) == 'string' then key = options.translate[key] end if options.readOnly then error( 'could not write to argument table key "' .. tostring(key) .. '"; the table is read-only', 2 ) elseif options.noOverwrite and args[key] ~= nil then error( 'could not write to argument table key "' .. tostring(key) .. '"; overwriting existing arguments is not permitted', 2 ) elseif val == nil then --[[ -- If the argument is to be overwritten with nil, we need to erase -- the value in metaArgs, so that __index, __pairs and __ipairs do -- not use a previous existing value, if present; and we also need -- to memoize the nil in nilArgs, so that the value isn't looked -- up in the argument tables if it is accessed again. --]] metaArgs[key] = nil nilArgs[key] = 'h' else metaArgs[key] = val end end local function translatenext(invariant) local k, v = next(invariant.t, invariant.k) invariant.k = k if k == nil then return nil elseif type(k) ~= 'string' or not options.backtranslate then return k, v else local backtranslate = options.backtranslate[k] if backtranslate == nil then -- Skip this one. This is a tail call, so this won't cause stack overflow return translatenext(invariant) else return backtranslate, v end end end metatable.__pairs = function () -- Called when pairs is run on the args table. if not metatable.donePairs then mergeArgs(argTables) metatable.donePairs = true end return translatenext, { t = metaArgs } end local function inext(t, i) -- This uses our __index metamethod local v = t[i + 1] if v ~= nil then return i + 1, v end end metatable.__ipairs = function (t) -- Called when ipairs is run on the args table. return inext, t, 0 end return args end return arguments 5qx9tzlul9ser30uxj9nbasjt92cevn Module:Category handler 828 42 69 2018-07-24T23:32:33Z Jspidersf 30511844 Created page with "-------------------------------------------------------------------------------- -- -- --..." 69 Scribunto text/plain -------------------------------------------------------------------------------- -- -- -- CATEGORY HANDLER -- -- -- -- This module implements the {{category handler}} template in Lua, -- -- with a few improvements: all namespaces and all namespace aliases -- -- are supported, and namespace names are detected automatically for -- -- the local wiki. This module requires [[Module:Namespace detect]] -- -- and [[Module:Yesno]] to be available on the local wiki. It can be -- -- configured for different wikis by altering the values in -- -- [[Module:Category handler/config]], and pages can be blacklisted -- -- from categorisation by using [[Module:Category handler/blacklist]]. -- -- -- -------------------------------------------------------------------------------- -- Load required modules local yesno = require('Module:Yesno') -- Lazily load things we don't always need local mShared, mappings local p = {} -------------------------------------------------------------------------------- -- Helper functions -------------------------------------------------------------------------------- local function trimWhitespace(s, removeBlanks) if type(s) ~= 'string' then return s end s = s:match('^%s*(.-)%s*$') if removeBlanks then if s ~= '' then return s else return nil end else return s end end -------------------------------------------------------------------------------- -- CategoryHandler class -------------------------------------------------------------------------------- local CategoryHandler = {} CategoryHandler.__index = CategoryHandler function CategoryHandler.new(data, args) local obj = setmetatable({ _data = data, _args = args }, CategoryHandler) -- Set the title object do local pagename = obj:parameter('demopage') local success, titleObj if pagename then success, titleObj = pcall(mw.title.new, pagename) end if success and titleObj then obj.title = titleObj if titleObj == mw.title.getCurrentTitle() then obj._usesCurrentTitle = true end else obj.title = mw.title.getCurrentTitle() obj._usesCurrentTitle = true end end -- Set suppression parameter values for _, key in ipairs{'nocat', 'categories'} do local value = obj:parameter(key) value = trimWhitespace(value, true) obj['_' .. key] = yesno(value) end do local subpage = obj:parameter('subpage') local category2 = obj:parameter('category2') if type(subpage) == 'string' then subpage = mw.ustring.lower(subpage) end if type(category2) == 'string' then subpage = mw.ustring.lower(category2) end obj._subpage = trimWhitespace(subpage, true) obj._category2 = trimWhitespace(category2) -- don't remove blank values end return obj end function CategoryHandler:parameter(key) local parameterNames = self._data.parameters[key] local pntype = type(parameterNames) if pntype == 'string' or pntype == 'number' then return self._args[parameterNames] elseif pntype == 'table' then for _, name in ipairs(parameterNames) do local value = self._args[name] if value ~= nil then return value end end return nil else error(string.format( 'invalid config key "%s"', tostring(key) ), 2) end end function CategoryHandler:isSuppressedByArguments() return -- See if a category suppression argument has been set. self._nocat == true or self._categories == false or ( self._category2 and self._category2 ~= self._data.category2Yes and self._category2 ~= self._data.category2Negative ) -- Check whether we are on a subpage, and see if categories are -- suppressed based on our subpage status. or self._subpage == self._data.subpageNo and self.title.isSubpage or self._subpage == self._data.subpageOnly and not self.title.isSubpage end function CategoryHandler:shouldSkipBlacklistCheck() -- Check whether the category suppression arguments indicate we -- should skip the blacklist check. return self._nocat == false or self._categories == true or self._category2 == self._data.category2Yes end function CategoryHandler:matchesBlacklist() if self._usesCurrentTitle then return self._data.currentTitleMatchesBlacklist else mShared = mShared or require('Module:Category handler/shared') return mShared.matchesBlacklist( self.title.prefixedText, mw.loadData('Module:Category handler/blacklist') ) end end function CategoryHandler:isSuppressed() -- Find if categories are suppressed by either the arguments or by -- matching the blacklist. return self:isSuppressedByArguments() or not self:shouldSkipBlacklistCheck() and self:matchesBlacklist() end function CategoryHandler:getNamespaceParameters() if self._usesCurrentTitle then return self._data.currentTitleNamespaceParameters else if not mappings then mShared = mShared or require('Module:Category handler/shared') mappings = mShared.getParamMappings(true) -- gets mappings with mw.loadData end return mShared.getNamespaceParameters( self.title, mappings ) end end function CategoryHandler:namespaceParametersExist() -- Find whether any namespace parameters have been specified. -- We use the order "all" --> namespace params --> "other" as this is what -- the old template did. if self:parameter('all') then return true end if not mappings then mShared = mShared or require('Module:Category handler/shared') mappings = mShared.getParamMappings(true) -- gets mappings with mw.loadData end for ns, params in pairs(mappings) do for i, param in ipairs(params) do if self._args[param] then return true end end end if self:parameter('other') then return true end return false end function CategoryHandler:getCategories() local params = self:getNamespaceParameters() local nsCategory for i, param in ipairs(params) do local value = self._args[param] if value ~= nil then nsCategory = value break end end if nsCategory ~= nil or self:namespaceParametersExist() then -- Namespace parameters exist - advanced usage. if nsCategory == nil then nsCategory = self:parameter('other') end local ret = {self:parameter('all')} local numParam = tonumber(nsCategory) if numParam and numParam >= 1 and math.floor(numParam) == numParam then -- nsCategory is an integer ret[#ret + 1] = self._args[numParam] else ret[#ret + 1] = nsCategory end if #ret < 1 then return nil else return table.concat(ret) end elseif self._data.defaultNamespaces[self.title.namespace] then -- Namespace parameters don't exist, simple usage. return self._args[1] end return nil end -------------------------------------------------------------------------------- -- Exports -------------------------------------------------------------------------------- local p = {} function p._exportClasses() -- Used for testing purposes. return { CategoryHandler = CategoryHandler } end function p._main(args, data) data = data or mw.loadData('Module:Category handler/data') local handler = CategoryHandler.new(data, args) if handler:isSuppressed() then return nil end return handler:getCategories() end function p.main(frame, data) data = data or mw.loadData('Module:Category handler/data') local args = require('Module:Arguments').getArgs(frame, { wrappers = data.wrappers, valueFunc = function (k, v) v = trimWhitespace(v) if type(k) == 'number' then if v ~= '' then return v else return nil end else return v end end }) return p._main(args, data) end return p letwavu3yvlayfzew66uuwixmwebq5b Module:Category handler/blacklist 828 43 70 2018-07-24T23:33:10Z Jspidersf 30511844 Created page with "-- This module contains the blacklist used by [[Module:Category handler]]. -- Pages that match Lua patterns in this list will not be categorised unless -- categorisation is ex..." 70 Scribunto text/plain -- This module contains the blacklist used by [[Module:Category handler]]. -- Pages that match Lua patterns in this list will not be categorised unless -- categorisation is explicitly requested. return { '^Main Page$', -- don't categorise the main page. -- Don't categorise the following pages or their subpages. -- "%f[/\0]" matches if the next character is "/" or the end of the string. '^Wikipedia:Cascade%-protected items%f[/\0]', '^User:UBX%f[/\0]', -- The userbox "template" space. '^User talk:UBX%f[/\0]', -- Don't categorise subpages of these pages, but allow -- categorisation of the base page. '^Wikipedia:Template messages/.*$', '/[aA]rchive' -- Don't categorise archives. } ne8sdldor304iu81gnqa05p401j3exc Module:Category handler/config 828 44 71 2018-07-24T23:33:36Z Jspidersf 30511844 Created page with "-------------------------------------------------------------------------------- -- [[Module:Category handler]] configuration data -- -- Lang..." 71 Scribunto text/plain -------------------------------------------------------------------------------- -- [[Module:Category handler]] configuration data -- -- Language-specific parameter names and values can be set here. -- -- For blacklist config, see [[Module:Category handler/blacklist]]. -- -------------------------------------------------------------------------------- local cfg = {} -- Don't edit this line. -------------------------------------------------------------------------------- -- Start configuration data -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Parameter names -- -- These configuration items specify custom parameter names. -- -- To add one extra name, you can use this format: -- -- -- -- foo = 'parameter name', -- -- -- -- To add multiple names, you can use this format: -- -- -- -- foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'}, -- -------------------------------------------------------------------------------- cfg.parameters = { -- The nocat and categories parameter suppress -- categorisation. They are used with Module:Yesno, and work as follows: -- -- cfg.nocat: -- Result of yesno() Effect -- true Categorisation is suppressed -- false Categorisation is allowed, and -- the blacklist check is skipped -- nil Categorisation is allowed -- -- cfg.categories: -- Result of yesno() Effect -- true Categorisation is allowed, and -- the blacklist check is skipped -- false Categorisation is suppressed -- nil Categorisation is allowed nocat = 'nocat', categories = 'categories', -- The parameter name for the legacy "category2" parameter. This skips the -- blacklist if set to the cfg.category2Yes value, and suppresses -- categorisation if present but equal to anything other than -- cfg.category2Yes or cfg.category2Negative. category2 = 'category2', -- cfg.subpage is the parameter name to specify how to behave on subpages. subpage = 'subpage', -- The parameter for data to return in all namespaces. all = 'all', -- The parameter name for data to return if no data is specified for the -- namespace that is detected. other = 'other', -- The parameter name used to specify a page other than the current page; -- used for testing and demonstration. demopage = 'page', } -------------------------------------------------------------------------------- -- Parameter values -- -- These are set values that can be used with certain parameters. Only one -- -- value can be specified, like this: -- -- -- -- cfg.foo = 'value name' -- -- -------------------------------------------------------------------------------- -- The following settings are used with the cfg.category2 parameter. Setting -- cfg.category2 to cfg.category2Yes skips the blacklist, and if cfg.category2 -- is present but equal to anything other than cfg.category2Yes or -- cfg.category2Negative then it supresses cateogrisation. cfg.category2Yes = 'yes' cfg.category2Negative = '¬' -- The following settings are used with the cfg.subpage parameter. -- cfg.subpageNo is the value to specify to not categorise on subpages; -- cfg.subpageOnly is the value to specify to only categorise on subpages. cfg.subpageNo = 'no' cfg.subpageOnly = 'only' -------------------------------------------------------------------------------- -- Default namespaces -- -- This is a table of namespaces to categorise by default. The keys are the -- -- namespace numbers. -- -------------------------------------------------------------------------------- cfg.defaultNamespaces = { [ 0] = true, -- main [ 6] = true, -- file [ 12] = true, -- help [ 14] = true, -- category [100] = true, -- portal [108] = true, -- book } -------------------------------------------------------------------------------- -- Wrappers -- -- This is a wrapper template or a list of wrapper templates to be passed to -- -- [[Module:Arguments]]. -- -------------------------------------------------------------------------------- cfg.wrappers = 'Template:Category handler' -------------------------------------------------------------------------------- -- End configuration data -- -------------------------------------------------------------------------------- return cfg -- Don't edit this line. 6ga9hbq2pdwalsvx68i53dmbr421rq5 Module:Category handler/data 828 45 72 2018-07-24T23:34:22Z Jspidersf 30511844 Created page with "-- This module assembles data to be passed to [[Module:Category handler]] using -- mw.loadData. This includes the configuration data and whether the current -- page matches th..." 72 Scribunto text/plain -- This module assembles data to be passed to [[Module:Category handler]] using -- mw.loadData. This includes the configuration data and whether the current -- page matches the title blacklist. local data = require('Module:Category handler/config') local mShared = require('Module:Category handler/shared') local blacklist = require('Module:Category handler/blacklist') local title = mw.title.getCurrentTitle() data.currentTitleMatchesBlacklist = mShared.matchesBlacklist( title.prefixedText, blacklist ) data.currentTitleNamespaceParameters = mShared.getNamespaceParameters( title, mShared.getParamMappings() ) return data k26mwixuaeijisfddb0sxkg82iux8v4 Module:Category handler/shared 828 46 73 2018-07-24T23:34:43Z Jspidersf 30511844 Created page with "-- This module contains shared functions used by [[Module:Category handler]] -- and its submodules. local p = {} function p.matchesBlacklist(page, blacklist) for i, pattern..." 73 Scribunto text/plain -- This module contains shared functions used by [[Module:Category handler]] -- and its submodules. local p = {} function p.matchesBlacklist(page, blacklist) for i, pattern in ipairs(blacklist) do local match = mw.ustring.match(page, pattern) if match then return true end end return false end function p.getParamMappings(useLoadData) local dataPage = 'Module:Namespace detect/data' if useLoadData then return mw.loadData(dataPage).mappings else return require(dataPage).mappings end end function p.getNamespaceParameters(titleObj, mappings) -- We don't use title.nsText for the namespace name because it adds -- underscores. local mappingsKey if titleObj.isTalkPage then mappingsKey = 'talk' else mappingsKey = mw.site.namespaces[titleObj.namespace].name end mappingsKey = mw.ustring.lower(mappingsKey) return mappings[mappingsKey] or {} end return p omlsnhudxz6juptvtxz7ns97jutbzc5 Module:Documentation 828 47 74 2018-07-24T23:35:07Z Jspidersf 30511844 Created page with "-- This module implements {{documentation}}. -- Get required modules. local getArgs = require('Module:Arguments').getArgs local messageBox = require('Module:Message box') --..." 74 Scribunto text/plain -- This module implements {{documentation}}. -- Get required modules. local getArgs = require('Module:Arguments').getArgs local messageBox = require('Module:Message box') -- Get the config table. local cfg = mw.loadData('Module:Documentation/config') local p = {} -- Often-used functions. local ugsub = mw.ustring.gsub ---------------------------------------------------------------------------- -- Helper functions -- -- These are defined as local functions, but are made available in the p -- table for testing purposes. ---------------------------------------------------------------------------- local function message(cfgKey, valArray, expectType) --[[ -- Gets a message from the cfg table and formats it if appropriate. -- The function raises an error if the value from the cfg table is not -- of the type expectType. The default type for expectType is 'string'. -- If the table valArray is present, strings such as $1, $2 etc. in the -- message are substituted with values from the table keys [1], [2] etc. -- For example, if the message "foo-message" had the value 'Foo $2 bar $1.', -- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz." --]] local msg = cfg[cfgKey] expectType = expectType or 'string' if type(msg) ~= expectType then error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2) end if not valArray then return msg end local function getMessageVal(match) match = tonumber(match) return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4) end local ret = ugsub(msg, '$([1-9][0-9]*)', getMessageVal) return ret end p.message = message local function makeWikilink(page, display) if display then return mw.ustring.format('[[%s|%s]]', page, display) else return mw.ustring.format('[[%s]]', page) end end p.makeWikilink = makeWikilink local function makeCategoryLink(cat, sort) local catns = mw.site.namespaces[14].name return makeWikilink(catns .. ':' .. cat, sort) end p.makeCategoryLink = makeCategoryLink local function makeUrlLink(url, display) return mw.ustring.format('[%s %s]', url, display) end p.makeUrlLink = makeUrlLink local function makeToolbar(...) local ret = {} local lim = select('#', ...) if lim < 1 then return nil end for i = 1, lim do ret[#ret + 1] = select(i, ...) end return '<small style="font-style: normal;">(' .. table.concat(ret, ' &#124; ') .. ')</small>' end p.makeToolbar = makeToolbar ---------------------------------------------------------------------------- -- Argument processing ---------------------------------------------------------------------------- local function makeInvokeFunc(funcName) return function (frame) local args = getArgs(frame, { valueFunc = function (key, value) if type(value) == 'string' then value = value:match('^%s*(.-)%s*$') -- Remove whitespace. if key == 'heading' or value ~= '' then return value else return nil end else return value end end }) return p[funcName](args) end end ---------------------------------------------------------------------------- -- Main function ---------------------------------------------------------------------------- p.main = makeInvokeFunc('_main') function p._main(args) --[[ -- This function defines logic flow for the module. -- @args - table of arguments passed by the user -- -- Messages: -- 'main-div-id' --> 'template-documentation' -- 'main-div-classes' --> 'template-documentation iezoomfix' --]] local env = p.getEnvironment(args) local root = mw.html.create() root :wikitext(p.protectionTemplate(env)) :wikitext(p.sandboxNotice(args, env)) -- This div tag is from {{documentation/start box}}, but moving it here -- so that we don't have to worry about unclosed tags. :tag('div') :attr('id', message('main-div-id')) :addClass(message('main-div-classes')) :css('padding', '12px') :newline() :wikitext(p._startBox(args, env)) :wikitext(p._content(args, env)) :tag('div') :css('clear', 'both') -- So right or left floating items don't stick out of the doc box. :newline() :done() :done() :wikitext(p._endBox(args, env)) :wikitext(p.addTrackingCategories(env)) return tostring(root) end ---------------------------------------------------------------------------- -- Environment settings ---------------------------------------------------------------------------- function p.getEnvironment(args) --[[ -- Returns a table with information about the environment, including title objects and other namespace- or -- path-related data. -- @args - table of arguments passed by the user -- -- Title objects include: -- env.title - the page we are making documentation for (usually the current title) -- env.templateTitle - the template (or module, file, etc.) -- env.docTitle - the /doc subpage. -- env.sandboxTitle - the /sandbox subpage. -- env.testcasesTitle - the /testcases subpage. -- env.printTitle - the print version of the template, located at the /Print subpage. -- -- Data includes: -- env.protectionLevels - the protection levels table of the title object. -- env.subjectSpace - the number of the title's subject namespace. -- env.docSpace - the number of the namespace the title puts its documentation in. -- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace. -- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template. -- -- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value -- returned will be nil. --]] local env, envFuncs = {}, {} -- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value -- returned by that function is memoized in the env table so that we don't call any of the functions -- more than once. (Nils won't be memoized.) setmetatable(env, { __index = function (t, key) local envFunc = envFuncs[key] if envFunc then local success, val = pcall(envFunc) if success then env[key] = val -- Memoise the value. return val end end return nil end }) function envFuncs.title() -- The title object for the current page, or a test page passed with args.page. local title local titleArg = args.page if titleArg then title = mw.title.new(titleArg) else title = mw.title.getCurrentTitle() end return title end function envFuncs.templateTitle() --[[ -- The template (or module, etc.) title object. -- Messages: -- 'sandbox-subpage' --> 'sandbox' -- 'testcases-subpage' --> 'testcases' --]] local subjectSpace = env.subjectSpace local title = env.title local subpage = title.subpageText if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then return mw.title.makeTitle(subjectSpace, title.baseText) else return mw.title.makeTitle(subjectSpace, title.text) end end function envFuncs.docTitle() --[[ -- Title object of the /doc subpage. -- Messages: -- 'doc-subpage' --> 'doc' --]] local title = env.title local docname = args[1] -- User-specified doc page. local docpage if docname then docpage = docname else docpage = env.docpageBase .. '/' .. message('doc-subpage') end return mw.title.new(docpage) end function envFuncs.sandboxTitle() --[[ -- Title object for the /sandbox subpage. -- Messages: -- 'sandbox-subpage' --> 'sandbox' --]] return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage')) end function envFuncs.testcasesTitle() --[[ -- Title object for the /testcases subpage. -- Messages: -- 'testcases-subpage' --> 'testcases' --]] return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage')) end function envFuncs.printTitle() --[[ -- Title object for the /Print subpage. -- Messages: -- 'print-subpage' --> 'Print' --]] return env.templateTitle:subPageTitle(message('print-subpage')) end function envFuncs.protectionLevels() -- The protection levels table of the title object. return env.title.protectionLevels end function envFuncs.subjectSpace() -- The subject namespace number. return mw.site.namespaces[env.title.namespace].subject.id end function envFuncs.docSpace() -- The documentation namespace number. For most namespaces this is the same as the -- subject namespace. However, pages in the Article, File, MediaWiki or Category -- namespaces must have their /doc, /sandbox and /testcases pages in talk space. local subjectSpace = env.subjectSpace if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then return subjectSpace + 1 else return subjectSpace end end function envFuncs.docpageBase() -- The base page of the /doc, /sandbox, and /testcases subpages. -- For some namespaces this is the talk page, rather than the template page. local templateTitle = env.templateTitle local docSpace = env.docSpace local docSpaceText = mw.site.namespaces[docSpace].name -- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon. return docSpaceText .. ':' .. templateTitle.text end function envFuncs.compareUrl() -- Diff link between the sandbox and the main template using [[Special:ComparePages]]. local templateTitle = env.templateTitle local sandboxTitle = env.sandboxTitle if templateTitle.exists and sandboxTitle.exists then local compareUrl = mw.uri.fullUrl( 'Special:ComparePages', {page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText} ) return tostring(compareUrl) else return nil end end return env end ---------------------------------------------------------------------------- -- Auxiliary templates ---------------------------------------------------------------------------- function p.sandboxNotice(args, env) --[=[ -- Generates a sandbox notice for display above sandbox pages. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]' -- 'sandbox-notice-blurb' --> 'This is the $1 for $2.' -- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).' -- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page' -- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page' -- 'sandbox-notice-pagetype-other' --> 'sandbox page' -- 'sandbox-notice-compare-link-display' --> 'diff' -- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.' -- 'sandbox-notice-testcases-link-display' --> 'test cases' -- 'sandbox-category' --> 'Template sandboxes' --]=] local title = env.title local sandboxTitle = env.sandboxTitle local templateTitle = env.templateTitle local subjectSpace = env.subjectSpace if not (subjectSpace and title and sandboxTitle and templateTitle and mw.title.equals(title, sandboxTitle)) then return nil end -- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text". local omargs = {} omargs.image = message('sandbox-notice-image') -- Get the text. We start with the opening blurb, which is something like -- "This is the template sandbox for [[Template:Foo]] (diff)." local text = '' local frame = mw.getCurrentFrame() local isPreviewing = frame:preprocess('{{REVISIONID}}') == '' -- True if the page is being previewed. local pagetype if subjectSpace == 10 then pagetype = message('sandbox-notice-pagetype-template') elseif subjectSpace == 828 then pagetype = message('sandbox-notice-pagetype-module') else pagetype = message('sandbox-notice-pagetype-other') end local templateLink = makeWikilink(templateTitle.prefixedText) local compareUrl = env.compareUrl if isPreviewing or not compareUrl then text = text .. message('sandbox-notice-blurb', {pagetype, templateLink}) else local compareDisplay = message('sandbox-notice-compare-link-display') local compareLink = makeUrlLink(compareUrl, compareDisplay) text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink}) end -- Get the test cases page blurb if the page exists. This is something like -- "See also the companion subpage for [[Template:Foo/testcases|test cases]]." local testcasesTitle = env.testcasesTitle if testcasesTitle and testcasesTitle.exists then if testcasesTitle.namespace == mw.site.namespaces.Module.id then local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display') local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display') local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay) local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay) text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink}) else local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display') local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay) text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink}) end end -- Add the sandbox to the sandbox category. text = text .. makeCategoryLink(message('sandbox-category')) omargs.text = text local ret = '<div style="clear: both;"></div>' ret = ret .. messageBox.main('ombox', omargs) return ret end function p.protectionTemplate(env) -- Generates the padlock icon in the top right. -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'protection-template' --> 'pp-template' -- 'protection-template-args' --> {docusage = 'yes'} local title = env.title local protectionLevels local protectionTemplate = message('protection-template') local namespace = title.namespace if not (protectionTemplate and (namespace == 10 or namespace == 828)) then -- Don't display the protection template if we are not in the template or module namespaces. return nil end protectionLevels = env.protectionLevels if not protectionLevels then return nil end local editLevels = protectionLevels.edit local moveLevels = protectionLevels.move if moveLevels and moveLevels[1] == 'sysop' or editLevels and editLevels[1] then -- The page is full-move protected, or full, template, or semi-protected. local frame = mw.getCurrentFrame() return frame:expandTemplate{title = protectionTemplate, args = message('protection-template-args', nil, 'table')} else return nil end end ---------------------------------------------------------------------------- -- Start box ---------------------------------------------------------------------------- p.startBox = makeInvokeFunc('_startBox') function p._startBox(args, env) --[[ -- This function generates the start box. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make -- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox -- which generate the box HTML. --]] env = env or p.getEnvironment(args) local links local content = args.content if not content then -- No need to include the links if the documentation is on the template page itself. local linksData = p.makeStartBoxLinksData(args, env) if linksData then links = p.renderStartBoxLinks(linksData) end end -- Generate the start box html. local data = p.makeStartBoxData(args, env, links) if data then return p.renderStartBox(data) else -- User specified no heading. return nil end end function p.makeStartBoxLinksData(args, env) --[[ -- Does initial processing of data to make the [view] [edit] [history] [purge] links. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'view-link-display' --> 'view' -- 'edit-link-display' --> 'edit' -- 'history-link-display' --> 'history' -- 'purge-link-display' --> 'purge' -- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace' -- 'module-preload' --> 'Template:Documentation/preload-module-doc' -- 'docpage-preload' --> 'Template:Documentation/preload' -- 'create-link-display' --> 'create' --]] local subjectSpace = env.subjectSpace local title = env.title local docTitle = env.docTitle if not title or not docTitle then return nil end local data = {} data.title = title data.docTitle = docTitle -- View, display, edit, and purge links if /doc exists. data.viewLinkDisplay = message('view-link-display') data.editLinkDisplay = message('edit-link-display') data.historyLinkDisplay = message('history-link-display') data.purgeLinkDisplay = message('purge-link-display') -- Create link if /doc doesn't exist. local preload = args.preload if not preload then if subjectSpace == 6 then -- File namespace preload = message('file-docpage-preload') elseif subjectSpace == 828 then -- Module namespace preload = message('module-preload') else preload = message('docpage-preload') end end data.preload = preload data.createLinkDisplay = message('create-link-display') return data end function p.renderStartBoxLinks(data) --[[ -- Generates the [view][edit][history][purge] or [create] links from the data table. -- @data - a table of data generated by p.makeStartBoxLinksData --]] local function escapeBrackets(s) -- Escapes square brackets with HTML entities. s = s:gsub('%[', '&#91;') -- Replace square brackets with HTML entities. s = s:gsub('%]', '&#93;') return s end local ret local docTitle = data.docTitle local title = data.title if docTitle.exists then local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay) local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay) local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay) local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay) ret = '[%s] [%s] [%s] [%s]' ret = escapeBrackets(ret) ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink) else local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay) ret = '[%s]' ret = escapeBrackets(ret) ret = mw.ustring.format(ret, createLink) end return ret end function p.makeStartBoxData(args, env, links) --[=[ -- Does initial processing of data to pass to the start-box render function, p.renderStartBox. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error. -- -- Messages: -- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=Documentation icon]]' -- 'template-namespace-heading' --> 'Template documentation' -- 'module-namespace-heading' --> 'Module documentation' -- 'file-namespace-heading' --> 'Summary' -- 'other-namespaces-heading' --> 'Documentation' -- 'start-box-linkclasses' --> 'mw-editsection-like plainlinks' -- 'start-box-link-id' --> 'doc_editlinks' -- 'testcases-create-link-display' --> 'create' --]=] local subjectSpace = env.subjectSpace if not subjectSpace then -- Default to an "other namespaces" namespace, so that we get at least some output -- if an error occurs. subjectSpace = 2 end local data = {} -- Heading local heading = args.heading -- Blank values are not removed. if heading == '' then -- Don't display the start box if the heading arg is defined but blank. return nil end if heading then data.heading = heading elseif subjectSpace == 10 then -- Template namespace data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading') elseif subjectSpace == 828 then -- Module namespace data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading') elseif subjectSpace == 6 then -- File namespace data.heading = message('file-namespace-heading') else data.heading = message('other-namespaces-heading') end -- Heading CSS local headingStyle = args['heading-style'] if headingStyle then data.headingStyleText = headingStyle elseif subjectSpace == 10 then -- We are in the template or template talk namespaces. data.headingFontWeight = 'bold' data.headingFontSize = '125%' else data.headingFontSize = '150%' end -- Data for the [view][edit][history][purge] or [create] links. if links then data.linksClass = message('start-box-linkclasses') data.linksId = message('start-box-link-id') data.links = links end return data end function p.renderStartBox(data) -- Renders the start box html. -- @data - a table of data generated by p.makeStartBoxData. local sbox = mw.html.create('div') sbox :css('padding-bottom', '3px') :css('border-bottom', '1px solid #aaa') :css('margin-bottom', '1ex') :newline() :tag('span') :cssText(data.headingStyleText) :css('font-weight', data.headingFontWeight) :css('font-size', data.headingFontSize) :wikitext(data.heading) local links = data.links if links then sbox:tag('span') :addClass(data.linksClass) :attr('id', data.linksId) :wikitext(links) end return tostring(sbox) end ---------------------------------------------------------------------------- -- Documentation content ---------------------------------------------------------------------------- p.content = makeInvokeFunc('_content') function p._content(args, env) -- Displays the documentation contents -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment env = env or p.getEnvironment(args) local docTitle = env.docTitle local content = args.content if not content and docTitle and docTitle.exists then content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText} end -- The line breaks below are necessary so that "=== Headings ===" at the start and end -- of docs are interpreted correctly. return '\n' .. (content or '') .. '\n' end p.contentTitle = makeInvokeFunc('_contentTitle') function p._contentTitle(args, env) env = env or p.getEnvironment(args) local docTitle = env.docTitle if not args.content and docTitle and docTitle.exists then return docTitle.prefixedText else return '' end end ---------------------------------------------------------------------------- -- End box ---------------------------------------------------------------------------- p.endBox = makeInvokeFunc('_endBox') function p._endBox(args, env) --[=[ -- This function generates the end box (also known as the link box). -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'fmbox-id' --> 'documentation-meta-data' -- 'fmbox-style' --> 'background-color: #ecfcf4' -- 'fmbox-textstyle' --> 'font-style: italic' -- -- The HTML is generated by the {{fmbox}} template, courtesy of [[Module:Message box]]. --]=] -- Get environment data. env = env or p.getEnvironment(args) local subjectSpace = env.subjectSpace local docTitle = env.docTitle if not subjectSpace or not docTitle then return nil end -- Check whether we should output the end box at all. Add the end -- box by default if the documentation exists or if we are in the -- user, module or template namespaces. local linkBox = args['link box'] if linkBox == 'off' or not ( docTitle.exists or subjectSpace == 2 or subjectSpace == 828 or subjectSpace == 10 ) then return nil end -- Assemble the arguments for {{fmbox}}. local fmargs = {} fmargs.id = message('fmbox-id') -- Sets 'documentation-meta-data' fmargs.image = 'none' fmargs.style = message('fmbox-style') -- Sets 'background-color: #ecfcf4' fmargs.textstyle = message('fmbox-textstyle') -- 'font-style: italic;' -- Assemble the fmbox text field. local text = '' if linkBox then text = text .. linkBox else text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]." if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then -- We are in the user, template or module namespaces. -- Add sandbox and testcases links. -- "Editors can experiment in this template's sandbox and testcases pages." text = text .. (p.makeExperimentBlurb(args, env) or '') text = text .. '<br />' if not args.content and not args[1] then -- "Please add categories to the /doc subpage." -- Don't show this message with inline docs or with an explicitly specified doc page, -- as then it is unclear where to add the categories. text = text .. (p.makeCategoriesBlurb(args, env) or '') end text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template" local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates. if printBlurb then text = text .. '<br />' .. printBlurb end end end fmargs.text = text return messageBox.main('fmbox', fmargs) end function p.makeDocPageBlurb(args, env) --[=[ -- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)". -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'edit-link-display' --> 'edit' -- 'history-link-display' --> 'history' -- 'transcluded-from-blurb' --> -- 'The above [[Wikipedia:Template documentation|documentation]] -- is [[Wikipedia:Transclusion|transcluded]] from $1.' -- 'module-preload' --> 'Template:Documentation/preload-module-doc' -- 'create-link-display' --> 'create' -- 'create-module-doc-blurb' --> -- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].' --]=] local docTitle = env.docTitle if not docTitle then return nil end local ret if docTitle.exists then -- /doc exists; link to it. local docLink = makeWikilink(docTitle.prefixedText) local editUrl = docTitle:fullUrl{action = 'edit'} local editDisplay = message('edit-link-display') local editLink = makeUrlLink(editUrl, editDisplay) local historyUrl = docTitle:fullUrl{action = 'history'} local historyDisplay = message('history-link-display') local historyLink = makeUrlLink(historyUrl, historyDisplay) ret = message('transcluded-from-blurb', {docLink}) .. ' ' .. makeToolbar(editLink, historyLink) .. '<br />' elseif env.subjectSpace == 828 then -- /doc does not exist; ask to create it. local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')} local createDisplay = message('create-link-display') local createLink = makeUrlLink(createUrl, createDisplay) ret = message('create-module-doc-blurb', {createLink}) .. '<br />' end return ret end function p.makeExperimentBlurb(args, env) --[[ -- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages." -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'sandbox-link-display' --> 'sandbox' -- 'sandbox-edit-link-display' --> 'edit' -- 'compare-link-display' --> 'diff' -- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox' -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox' -- 'sandbox-create-link-display' --> 'create' -- 'mirror-edit-summary' --> 'Create sandbox version of $1' -- 'mirror-link-display' --> 'mirror' -- 'mirror-link-preload' --> 'Template:Documentation/mirror' -- 'sandbox-link-display' --> 'sandbox' -- 'testcases-link-display' --> 'testcases' -- 'testcases-edit-link-display'--> 'edit' -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox' -- 'testcases-create-link-display' --> 'create' -- 'testcases-link-display' --> 'testcases' -- 'testcases-edit-link-display' --> 'edit' -- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases' -- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases' -- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.' -- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.' --]] local subjectSpace = env.subjectSpace local templateTitle = env.templateTitle local sandboxTitle = env.sandboxTitle local testcasesTitle = env.testcasesTitle local templatePage = templateTitle.prefixedText if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then return nil end -- Make links. local sandboxLinks, testcasesLinks if sandboxTitle.exists then local sandboxPage = sandboxTitle.prefixedText local sandboxDisplay = message('sandbox-link-display') local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay) local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'} local sandboxEditDisplay = message('sandbox-edit-link-display') local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay) local compareUrl = env.compareUrl local compareLink if compareUrl then local compareDisplay = message('compare-link-display') compareLink = makeUrlLink(compareUrl, compareDisplay) end sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink) else local sandboxPreload if subjectSpace == 828 then sandboxPreload = message('module-sandbox-preload') else sandboxPreload = message('template-sandbox-preload') end local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload} local sandboxCreateDisplay = message('sandbox-create-link-display') local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay) local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)}) local mirrorPreload = message('mirror-link-preload') local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary} local mirrorDisplay = message('mirror-link-display') local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay) sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink) end if testcasesTitle.exists then local testcasesPage = testcasesTitle.prefixedText local testcasesDisplay = message('testcases-link-display') local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay) local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'} local testcasesEditDisplay = message('testcases-edit-link-display') local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay) testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink) else local testcasesPreload if subjectSpace == 828 then testcasesPreload = message('module-testcases-preload') else testcasesPreload = message('template-testcases-preload') end local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload} local testcasesCreateDisplay = message('testcases-create-link-display') local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay) testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink) end local messageName if subjectSpace == 828 then messageName = 'experiment-blurb-module' else messageName = 'experiment-blurb-template' end return message(messageName, {sandboxLinks, testcasesLinks}) end function p.makeCategoriesBlurb(args, env) --[[ -- Generates the text "Please add categories to the /doc subpage." -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'doc-link-display' --> '/doc' -- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.' --]] local docTitle = env.docTitle if not docTitle then return nil end local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display')) return message('add-categories-blurb', {docPathLink}) end function p.makeSubpagesBlurb(args, env) --[[ -- Generates the "Subpages of this template" link. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'template-pagetype' --> 'template' -- 'module-pagetype' --> 'module' -- 'default-pagetype' --> 'page' -- 'subpages-link-display' --> 'Subpages of this $1' --]] local subjectSpace = env.subjectSpace local templateTitle = env.templateTitle if not subjectSpace or not templateTitle then return nil end local pagetype if subjectSpace == 10 then pagetype = message('template-pagetype') elseif subjectSpace == 828 then pagetype = message('module-pagetype') else pagetype = message('default-pagetype') end local subpagesLink = makeWikilink( 'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/', message('subpages-link-display', {pagetype}) ) return message('subpages-blurb', {subpagesLink}) end function p.makePrintBlurb(args, env) --[=[ -- Generates the blurb displayed when there is a print version of the template available. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'print-link-display' --> '/Print' -- 'print-blurb' --> 'A [[Help:Books/for experts#Improving the book layout|print version]]' -- .. ' of this template exists at $1.' -- .. ' If you make a change to this template, please update the print version as well.' -- 'display-print-category' --> true -- 'print-category' --> 'Templates with print versions' --]=] local printTitle = env.printTitle if not printTitle then return nil end local ret if printTitle.exists then local printLink = makeWikilink(printTitle.prefixedText, message('print-link-display')) ret = message('print-blurb', {printLink}) local displayPrintCategory = message('display-print-category', nil, 'boolean') if displayPrintCategory then ret = ret .. makeCategoryLink(message('print-category')) end end return ret end ---------------------------------------------------------------------------- -- Tracking categories ---------------------------------------------------------------------------- function p.addTrackingCategories(env) --[[ -- Check if {{documentation}} is transcluded on a /doc or /testcases page. -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'display-strange-usage-category' --> true -- 'doc-subpage' --> 'doc' -- 'testcases-subpage' --> 'testcases' -- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage' -- -- /testcases pages in the module namespace are not categorised, as they may have -- {{documentation}} transcluded automatically. --]] local title = env.title local subjectSpace = env.subjectSpace if not title or not subjectSpace then return nil end local subpage = title.subpageText local ret = '' if message('display-strange-usage-category', nil, 'boolean') and ( subpage == message('doc-subpage') or subjectSpace ~= 828 and subpage == message('testcases-subpage') ) then ret = ret .. makeCategoryLink(message('strange-usage-category')) end return ret end return p aosd2iviyxhuhe9y5gmyw4d8mqxxzky Module:Documentation/config 828 48 75 2018-07-24T23:35:31Z Jspidersf 30511844 Created page with "---------------------------------------------------------------------------------------------------- -- -- Configuration for Module:Documentation..." 75 Scribunto text/plain ---------------------------------------------------------------------------------------------------- -- -- Configuration for Module:Documentation -- -- Here you can set the values of the parameters and messages used in Module:Documentation to -- localise it to your wiki and your language. Unless specified otherwise, values given here -- should be string values. ---------------------------------------------------------------------------------------------------- local cfg = {} -- Do not edit this line. ---------------------------------------------------------------------------------------------------- -- Protection template configuration ---------------------------------------------------------------------------------------------------- -- cfg['protection-template'] -- The name of the template that displays the protection icon (a padlock on enwiki). cfg['protection-template'] = 'pp-template' -- cfg['protection-reason-edit'] -- The protection reason for edit-protected templates to pass to -- [[Module:Protection banner]]. cfg['protection-reason-edit'] = 'template' --[[ -- cfg['protection-template-args'] -- Any arguments to send to the protection template. This should be a Lua table. -- For example, if the protection template is "pp-template", and the wikitext template invocation -- looks like "{{pp-template|docusage=yes}}", then this table should look like "{docusage = 'yes'}". --]] cfg['protection-template-args'] = {docusage = 'yes'} --[[ ---------------------------------------------------------------------------------------------------- -- Sandbox notice configuration -- -- On sandbox pages the module can display a template notifying users that the current page is a -- sandbox, and the location of test cases pages, etc. The module decides whether the page is a -- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the -- messages that the notices contains. ---------------------------------------------------------------------------------------------------- --]] -- cfg['sandbox-notice-image'] -- The image displayed in the sandbox notice. cfg['sandbox-notice-image'] = '[[Image:Sandbox.svg|50px|alt=|link=]]' --[[ -- cfg['sandbox-notice-pagetype-template'] -- cfg['sandbox-notice-pagetype-module'] -- cfg['sandbox-notice-pagetype-other'] -- The page type of the sandbox page. The message that is displayed depends on the current subject -- namespace. This message is used in either cfg['sandbox-notice-blurb'] or -- cfg['sandbox-notice-diff-blurb']. --]] cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page' cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page' cfg['sandbox-notice-pagetype-other'] = 'sandbox page' --[[ -- cfg['sandbox-notice-blurb'] -- cfg['sandbox-notice-diff-blurb'] -- cfg['sandbox-notice-diff-display'] -- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence -- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page -- type, which is either cfg['sandbox-notice-pagetype-template'], -- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what -- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between -- the sandbox and the main template. The display value of the diff link is set by -- cfg['sandbox-notice-compare-link-display']. --]] cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.' cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).' cfg['sandbox-notice-compare-link-display'] = 'diff' --[[ -- cfg['sandbox-notice-testcases-blurb'] -- cfg['sandbox-notice-testcases-link-display'] -- cfg['sandbox-notice-testcases-run-blurb'] -- cfg['sandbox-notice-testcases-run-link-display'] -- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page -- corresponding to this sandbox that they can edit. $1 is a link to the test cases page. -- cfg['sandbox-notice-testcases-link-display'] is the display value for that link. -- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page -- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test -- cases page, and $2 is a link to the page to run it. -- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test -- cases. --]] cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.' cfg['sandbox-notice-testcases-link-display'] = 'test cases' cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).' cfg['sandbox-notice-testcases-run-link-display'] = 'run' -- cfg['sandbox-category'] -- A category to add to all template sandboxes. cfg['sandbox-category'] = 'Template sandboxes' ---------------------------------------------------------------------------------------------------- -- Start box configuration ---------------------------------------------------------------------------------------------------- -- cfg['documentation-icon-wikitext'] -- The wikitext for the icon shown at the top of the template. cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=Documentation icon]]' -- cfg['template-namespace-heading'] -- The heading shown in the template namespace. cfg['template-namespace-heading'] = 'Template documentation' -- cfg['module-namespace-heading'] -- The heading shown in the module namespace. cfg['module-namespace-heading'] = 'Module documentation' -- cfg['file-namespace-heading'] -- The heading shown in the file namespace. cfg['file-namespace-heading'] = 'Summary' -- cfg['other-namespaces-heading'] -- The heading shown in other namespaces. cfg['other-namespaces-heading'] = 'Documentation' -- cfg['view-link-display'] -- The text to display for "view" links. cfg['view-link-display'] = 'view' -- cfg['edit-link-display'] -- The text to display for "edit" links. cfg['edit-link-display'] = 'edit' -- cfg['history-link-display'] -- The text to display for "history" links. cfg['history-link-display'] = 'history' -- cfg['purge-link-display'] -- The text to display for "purge" links. cfg['purge-link-display'] = 'purge' -- cfg['create-link-display'] -- The text to display for "create" links. cfg['create-link-display'] = 'create' ---------------------------------------------------------------------------------------------------- -- Link box (end box) configuration ---------------------------------------------------------------------------------------------------- -- cfg['transcluded-from-blurb'] -- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page. cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from $1.' --[[ -- cfg['create-module-doc-blurb'] -- Notice displayed in the module namespace when the documentation subpage does not exist. -- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the -- display cfg['create-link-display']. --]] cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].' ---------------------------------------------------------------------------------------------------- -- Experiment blurb configuration ---------------------------------------------------------------------------------------------------- --[[ -- cfg['experiment-blurb-template'] -- cfg['experiment-blurb-module'] -- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages. -- It is only shown in the template and module namespaces. With the default English settings, it -- might look like this: -- -- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. -- -- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links. -- -- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending -- on what namespace we are in. -- -- Parameters: -- -- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format: -- -- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display']) -- -- If the sandbox doesn't exist, it is in the format: -- -- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display']) -- -- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload'] -- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display'] -- loads a default edit summary of cfg['mirror-edit-summary']. -- -- $2 is a link to the test cases page. If the test cases page exists, it is in the following format: -- -- cfg['testcases-link-display'] (cfg['testcases-edit-link-display']) -- -- If the test cases page doesn't exist, it is in the format: -- -- cfg['testcases-link-display'] (cfg['testcases-create-link-display']) -- -- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the -- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current -- namespace. --]] cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages." cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages." ---------------------------------------------------------------------------------------------------- -- Sandbox link configuration ---------------------------------------------------------------------------------------------------- -- cfg['sandbox-subpage'] -- The name of the template subpage typically used for sandboxes. cfg['sandbox-subpage'] = 'sandbox' -- cfg['template-sandbox-preload'] -- Preload file for template sandbox pages. cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox' -- cfg['module-sandbox-preload'] -- Preload file for Lua module sandbox pages. cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox' -- cfg['sandbox-link-display'] -- The text to display for "sandbox" links. cfg['sandbox-link-display'] = 'sandbox' -- cfg['sandbox-edit-link-display'] -- The text to display for sandbox "edit" links. cfg['sandbox-edit-link-display'] = 'edit' -- cfg['sandbox-create-link-display'] -- The text to display for sandbox "create" links. cfg['sandbox-create-link-display'] = 'create' -- cfg['compare-link-display'] -- The text to display for "compare" links. cfg['compare-link-display'] = 'diff' -- cfg['mirror-edit-summary'] -- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the -- template page. cfg['mirror-edit-summary'] = 'Create sandbox version of $1' -- cfg['mirror-link-display'] -- The text to display for "mirror" links. cfg['mirror-link-display'] = 'mirror' -- cfg['mirror-link-preload'] -- The page to preload when a user clicks the "mirror" link. cfg['mirror-link-preload'] = 'Template:Documentation/mirror' ---------------------------------------------------------------------------------------------------- -- Test cases link configuration ---------------------------------------------------------------------------------------------------- -- cfg['testcases-subpage'] -- The name of the template subpage typically used for test cases. cfg['testcases-subpage'] = 'testcases' -- cfg['template-testcases-preload'] -- Preload file for template test cases pages. cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases' -- cfg['module-testcases-preload'] -- Preload file for Lua module test cases pages. cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases' -- cfg['testcases-link-display'] -- The text to display for "testcases" links. cfg['testcases-link-display'] = 'testcases' -- cfg['testcases-edit-link-display'] -- The text to display for test cases "edit" links. cfg['testcases-edit-link-display'] = 'edit' -- cfg['testcases-create-link-display'] -- The text to display for test cases "create" links. cfg['testcases-create-link-display'] = 'create' ---------------------------------------------------------------------------------------------------- -- Add categories blurb configuration ---------------------------------------------------------------------------------------------------- --[[ -- cfg['add-categories-blurb'] -- Text to direct users to add categories to the /doc subpage. Not used if the "content" or -- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a -- link to the /doc subpage with a display value of cfg['doc-link-display']. --]] cfg['add-categories-blurb'] = 'Please add categories to the $1 subpage.' -- cfg['doc-link-display'] -- The text to display when linking to the /doc subpage. cfg['doc-link-display'] = '/doc' ---------------------------------------------------------------------------------------------------- -- Subpages link configuration ---------------------------------------------------------------------------------------------------- --[[ -- cfg['subpages-blurb'] -- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a -- display value of cfg['subpages-link-display']. In the English version this blurb is simply -- the link followed by a period, and the link display provides the actual text. --]] cfg['subpages-blurb'] = '$1.' --[[ -- cfg['subpages-link-display'] -- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'], -- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in -- the template namespace, the module namespace, or another namespace. --]] cfg['subpages-link-display'] = 'Subpages of this $1' -- cfg['template-pagetype'] -- The pagetype to display for template pages. cfg['template-pagetype'] = 'template' -- cfg['module-pagetype'] -- The pagetype to display for Lua module pages. cfg['module-pagetype'] = 'module' -- cfg['default-pagetype'] -- The pagetype to display for pages other than templates or Lua modules. cfg['default-pagetype'] = 'page' ---------------------------------------------------------------------------------------------------- -- Doc link configuration ---------------------------------------------------------------------------------------------------- -- cfg['doc-subpage'] -- The name of the subpage typically used for documentation pages. cfg['doc-subpage'] = 'doc' -- cfg['file-docpage-preload'] -- Preload file for documentation page in the file namespace. cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace' -- cfg['docpage-preload'] -- Preload file for template documentation pages in all namespaces. cfg['docpage-preload'] = 'Template:Documentation/preload' -- cfg['module-preload'] -- Preload file for Lua module documentation pages. cfg['module-preload'] = 'Template:Documentation/preload-module-doc' ---------------------------------------------------------------------------------------------------- -- Print version configuration ---------------------------------------------------------------------------------------------------- -- cfg['print-subpage'] -- The name of the template subpage used for print versions. cfg['print-subpage'] = 'Print' -- cfg['print-link-display'] -- The text to display when linking to the /Print subpage. cfg['print-link-display'] = '/Print' -- cfg['print-blurb'] -- Text to display if a /Print subpage exists. $1 is a link to the subpage with a display value of cfg['print-link-display']. cfg['print-blurb'] = 'A [[Help:Books/for experts#Improving the book layout|print version]] of this template exists at $1.' .. ' If you make a change to this template, please update the print version as well.' -- cfg['display-print-category'] -- Set to true to enable output of cfg['print-category'] if a /Print subpage exists. -- This should be a boolean value (either true or false). cfg['display-print-category'] = true -- cfg['print-category'] -- Category to output if cfg['display-print-category'] is set to true, and a /Print subpage exists. cfg['print-category'] = 'Templates with print versions' ---------------------------------------------------------------------------------------------------- -- HTML and CSS configuration ---------------------------------------------------------------------------------------------------- -- cfg['main-div-id'] -- The "id" attribute of the main HTML "div" tag. cfg['main-div-id'] = 'template-documentation' -- cfg['main-div-classes'] -- The CSS classes added to the main HTML "div" tag. cfg['main-div-classes'] = 'template-documentation iezoomfix' -- cfg['start-box-linkclasses'] -- The CSS classes used for the [view][edit][history] or [create] links in the start box. cfg['start-box-linkclasses'] = 'mw-editsection-like plainlinks' -- cfg['start-box-link-id'] -- The HTML "id" attribute for the links in the start box. cfg['start-box-link-id'] = 'doc_editlinks' ---------------------------------------------------------------------------------------------------- -- {{fmbox}} template configuration ---------------------------------------------------------------------------------------------------- -- cfg['fmbox-id'] -- The id sent to the "id" parameter of the {{fmbox}} template. cfg['fmbox-id'] = 'documentation-meta-data' -- cfg['fmbox-style'] -- The value sent to the style parameter of {{fmbox}}. cfg['fmbox-style'] = 'background-color: #ecfcf4' -- cfg['fmbox-textstyle'] -- The value sent to the "textstyle parameter of {{fmbox}}. cfg['fmbox-textstyle'] = 'font-style: italic' ---------------------------------------------------------------------------------------------------- -- Tracking category configuration ---------------------------------------------------------------------------------------------------- -- cfg['display-strange-usage-category'] -- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage -- or a /testcases subpage. This should be a boolean value (either true or false). cfg['display-strange-usage-category'] = true -- cfg['strange-usage-category'] -- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a -- /doc subpage or a /testcases subpage. cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage' --[[ ---------------------------------------------------------------------------------------------------- -- End configuration -- -- Don't edit anything below this line. ---------------------------------------------------------------------------------------------------- --]] return cfg 6qstmwxrhp4hoo3xj318lwlruk6prsn Module:Message box 828 49 76 2018-07-24T23:35:58Z Jspidersf 30511844 Created page with "-- This is a meta-module for producing message box templates, including -- {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}. -- Load necessary mo..." 76 Scribunto text/plain -- This is a meta-module for producing message box templates, including -- {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}. -- Load necessary modules. require('Module:No globals') local getArgs local categoryHandler = require('Module:Category handler')._main local yesno = require('Module:Yesno') -- Get a language object for formatDate and ucfirst. local lang = mw.language.getContentLanguage() -------------------------------------------------------------------------------- -- Helper functions -------------------------------------------------------------------------------- local function getTitleObject(...) -- Get the title object, passing the function through pcall -- in case we are over the expensive function count limit. local success, title = pcall(mw.title.new, ...) if success then return title end end local function union(t1, t2) -- Returns the union of two arrays. local vals = {} for i, v in ipairs(t1) do vals[v] = true end for i, v in ipairs(t2) do vals[v] = true end local ret = {} for k in pairs(vals) do table.insert(ret, k) end table.sort(ret) return ret end local function getArgNums(args, prefix) local nums = {} for k, v in pairs(args) do local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$') if num then table.insert(nums, tonumber(num)) end end table.sort(nums) return nums end -------------------------------------------------------------------------------- -- Box class definition -------------------------------------------------------------------------------- local MessageBox = {} MessageBox.__index = MessageBox function MessageBox.new(boxType, args, cfg) args = args or {} local obj = {} -- Set the title object and the namespace. obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle() -- Set the config for our box type. obj.cfg = cfg[boxType] if not obj.cfg then local ns = obj.title.namespace -- boxType is "mbox" or invalid input if ns == 0 then obj.cfg = cfg.ambox -- main namespace elseif ns == 6 then obj.cfg = cfg.imbox -- file namespace elseif ns == 14 then obj.cfg = cfg.cmbox -- category namespace else local nsTable = mw.site.namespaces[ns] if nsTable and nsTable.isTalk then obj.cfg = cfg.tmbox -- any talk namespace else obj.cfg = cfg.ombox -- other namespaces or invalid input end end end -- Set the arguments, and remove all blank arguments except for the ones -- listed in cfg.allowBlankParams. do local newArgs = {} for k, v in pairs(args) do if v ~= '' then newArgs[k] = v end end for i, param in ipairs(obj.cfg.allowBlankParams or {}) do newArgs[param] = args[param] end obj.args = newArgs end -- Define internal data structure. obj.categories = {} obj.classes = {} return setmetatable(obj, MessageBox) end function MessageBox:addCat(ns, cat, sort) if not cat then return nil end if sort then cat = string.format('[[Category:%s|%s]]', cat, sort) else cat = string.format('[[Category:%s]]', cat) end self.categories[ns] = self.categories[ns] or {} table.insert(self.categories[ns], cat) end function MessageBox:addClass(class) if not class then return nil end table.insert(self.classes, class) end function MessageBox:setParameters() local args = self.args local cfg = self.cfg -- Get type data. self.type = args.type local typeData = cfg.types[self.type] self.invalidTypeError = cfg.showInvalidTypeError and self.type and not typeData typeData = typeData or cfg.types[cfg.default] self.typeClass = typeData.class self.typeImage = typeData.image -- Find if the box has been wrongly substituted. self.isSubstituted = cfg.substCheck and args.subst == 'SUBST' -- Find whether we are using a small message box. self.isSmall = cfg.allowSmall and ( cfg.smallParam and args.small == cfg.smallParam or not cfg.smallParam and yesno(args.small) ) -- Add attributes, classes and styles. self.id = args.id self:addClass( cfg.usePlainlinksParam and yesno(args.plainlinks or true) and 'plainlinks' ) for _, class in ipairs(cfg.classes or {}) do self:addClass(class) end if self.isSmall then self:addClass(cfg.smallClass or 'mbox-small') end self:addClass(self.typeClass) self:addClass(args.class) self.style = args.style self.attrs = args.attrs -- Set text style. self.textstyle = args.textstyle -- Find if we are on the template page or not. This functionality is only -- used if useCollapsibleTextFields is set, or if both cfg.templateCategory -- and cfg.templateCategoryRequireName are set. self.useCollapsibleTextFields = cfg.useCollapsibleTextFields if self.useCollapsibleTextFields or cfg.templateCategory and cfg.templateCategoryRequireName then self.name = args.name if self.name then local templateName = mw.ustring.match( self.name, '^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$' ) or self.name templateName = 'Template:' .. templateName self.templateTitle = getTitleObject(templateName) end self.isTemplatePage = self.templateTitle and mw.title.equals(self.title, self.templateTitle) end -- Process data for collapsible text fields. At the moment these are only -- used in {{ambox}}. if self.useCollapsibleTextFields then -- Get the self.issue value. if self.isSmall and args.smalltext then self.issue = args.smalltext else local sect if args.sect == '' then sect = 'This ' .. (cfg.sectionDefault or 'page') elseif type(args.sect) == 'string' then sect = 'This ' .. args.sect end local issue = args.issue issue = type(issue) == 'string' and issue ~= '' and issue or nil local text = args.text text = type(text) == 'string' and text or nil local issues = {} table.insert(issues, sect) table.insert(issues, issue) table.insert(issues, text) self.issue = table.concat(issues, ' ') end -- Get the self.talk value. local talk = args.talk -- Show talk links on the template page or template subpages if the talk -- parameter is blank. if talk == '' and self.templateTitle and ( mw.title.equals(self.templateTitle, self.title) or self.title:isSubpageOf(self.templateTitle) ) then talk = '#' elseif talk == '' then talk = nil end if talk then -- If the talk value is a talk page, make a link to that page. Else -- assume that it's a section heading, and make a link to the talk -- page of the current page with that section heading. local talkTitle = getTitleObject(talk) local talkArgIsTalkPage = true if not talkTitle or not talkTitle.isTalkPage then talkArgIsTalkPage = false talkTitle = getTitleObject( self.title.text, mw.site.namespaces[self.title.namespace].talk.id ) end if talkTitle and talkTitle.exists then local talkText = 'Relevant discussion may be found on' if talkArgIsTalkPage then talkText = string.format( '%s [[%s|%s]].', talkText, talk, talkTitle.prefixedText ) else talkText = string.format( '%s the [[%s#%s|talk page]].', talkText, talkTitle.prefixedText, talk ) end self.talk = talkText end end -- Get other values. self.fix = args.fix ~= '' and args.fix or nil local date if args.date and args.date ~= '' then date = args.date elseif args.date == '' and self.isTemplatePage then date = lang:formatDate('F Y') end if date then self.date = string.format(" <small>''(%s)''</small>", date) end self.info = args.info end -- Set the non-collapsible text field. At the moment this is used by all box -- types other than ambox, and also by ambox when small=yes. if self.isSmall then self.text = args.smalltext or args.text else self.text = args.text end -- Set the below row. self.below = cfg.below and args.below -- General image settings. self.imageCellDiv = not self.isSmall and cfg.imageCellDiv self.imageEmptyCell = cfg.imageEmptyCell if cfg.imageEmptyCellStyle then self.imageEmptyCellStyle = 'border:none;padding:0px;width:1px' end -- Left image settings. local imageLeft = self.isSmall and args.smallimage or args.image if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none' or not cfg.imageCheckBlank and imageLeft ~= 'none' then self.imageLeft = imageLeft if not imageLeft then local imageSize = self.isSmall and (cfg.imageSmallSize or '30x30px') or '40x40px' self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage or 'Imbox notice.png', imageSize) end end -- Right image settings. local imageRight = self.isSmall and args.smallimageright or args.imageright if not (cfg.imageRightNone and imageRight == 'none') then self.imageRight = imageRight end end function MessageBox:setMainspaceCategories() local args = self.args local cfg = self.cfg if not cfg.allowMainspaceCategories then return nil end local nums = {} for _, prefix in ipairs{'cat', 'category', 'all'} do args[prefix .. '1'] = args[prefix] nums = union(nums, getArgNums(args, prefix)) end -- The following is roughly equivalent to the old {{Ambox/category}}. local date = args.date date = type(date) == 'string' and date local preposition = 'from' for _, num in ipairs(nums) do local mainCat = args['cat' .. tostring(num)] or args['category' .. tostring(num)] local allCat = args['all' .. tostring(num)] mainCat = type(mainCat) == 'string' and mainCat allCat = type(allCat) == 'string' and allCat if mainCat and date and date ~= '' then local catTitle = string.format('%s %s %s', mainCat, preposition, date) self:addCat(0, catTitle) catTitle = getTitleObject('Category:' .. catTitle) if not catTitle or not catTitle.exists then self:addCat(0, 'Articles with invalid date parameter in template') end elseif mainCat and (not date or date == '') then self:addCat(0, mainCat) end if allCat then self:addCat(0, allCat) end end end function MessageBox:setTemplateCategories() local args = self.args local cfg = self.cfg -- Add template categories. if cfg.templateCategory then if cfg.templateCategoryRequireName then if self.isTemplatePage then self:addCat(10, cfg.templateCategory) end elseif not self.title.isSubpage then self:addCat(10, cfg.templateCategory) end end -- Add template error categories. if cfg.templateErrorCategory then local templateErrorCategory = cfg.templateErrorCategory local templateCat, templateSort if not self.name and not self.title.isSubpage then templateCat = templateErrorCategory elseif self.isTemplatePage then local paramsToCheck = cfg.templateErrorParamsToCheck or {} local count = 0 for i, param in ipairs(paramsToCheck) do if not args[param] then count = count + 1 end end if count > 0 then templateCat = templateErrorCategory templateSort = tostring(count) end if self.categoryNums and #self.categoryNums > 0 then templateCat = templateErrorCategory templateSort = 'C' end end self:addCat(10, templateCat, templateSort) end end function MessageBox:setAllNamespaceCategories() -- Set categories for all namespaces. if self.invalidTypeError then local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort) end if self.isSubstituted then self:addCat('all', 'Pages with incorrectly substituted templates') end end function MessageBox:setCategories() if self.title.namespace == 0 then self:setMainspaceCategories() elseif self.title.namespace == 10 then self:setTemplateCategories() end self:setAllNamespaceCategories() end function MessageBox:renderCategories() -- Convert category tables to strings and pass them through -- [[Module:Category handler]]. return categoryHandler{ main = table.concat(self.categories[0] or {}), template = table.concat(self.categories[10] or {}), all = table.concat(self.categories.all or {}), nocat = self.args.nocat, page = self.args.page } end function MessageBox:export() local root = mw.html.create() -- Add the subst check error. if self.isSubstituted and self.name then root:tag('b') :addClass('error') :wikitext(string.format( 'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.', mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}') )) end -- Create the box table. local boxTable = root:tag('table') boxTable:attr('id', self.id or nil) for i, class in ipairs(self.classes or {}) do boxTable:addClass(class or nil) end boxTable :cssText(self.style or nil) :attr('role', 'presentation') if self.attrs then boxTable:attr(self.attrs) end -- Add the left-hand image. local row = boxTable:tag('tr') if self.imageLeft then local imageLeftCell = row:tag('td'):addClass('mbox-image') if self.imageCellDiv then -- If we are using a div, redefine imageLeftCell so that the image -- is inside it. Divs use style="width: 52px;", which limits the -- image width to 52px. If any images in a div are wider than that, -- they may overlap with the text or cause other display problems. imageLeftCell = imageLeftCell:tag('div'):css('width', '52px') end imageLeftCell:wikitext(self.imageLeft or nil) elseif self.imageEmptyCell then -- Some message boxes define an empty cell if no image is specified, and -- some don't. The old template code in templates where empty cells are -- specified gives the following hint: "No image. Cell with some width -- or padding necessary for text cell to have 100% width." row:tag('td') :addClass('mbox-empty-cell') :cssText(self.imageEmptyCellStyle or nil) end -- Add the text. local textCell = row:tag('td'):addClass('mbox-text') if self.useCollapsibleTextFields then -- The message box uses advanced text parameters that allow things to be -- collapsible. At the moment, only ambox uses this. textCell:cssText(self.textstyle or nil) local textCellSpan = textCell:tag('span') textCellSpan :addClass('mbox-text-span') :wikitext(self.issue or nil) if not self.isSmall then textCellSpan:tag('span') :addClass('hide-when-compact') :wikitext(self.talk and (' ' .. self.talk) or nil) :wikitext(self.fix and (' ' .. self.fix) or nil) end textCellSpan:wikitext(self.date and (' ' .. self.date) or nil) if not self.isSmall then textCellSpan :tag('span') :addClass('hide-when-compact') :wikitext(self.info and (' ' .. self.info) or nil) end else -- Default text formatting - anything goes. textCell :cssText(self.textstyle or nil) :wikitext(self.text or nil) end -- Add the right-hand image. if self.imageRight then local imageRightCell = row:tag('td'):addClass('mbox-imageright') if self.imageCellDiv then -- If we are using a div, redefine imageRightCell so that the image -- is inside it. imageRightCell = imageRightCell:tag('div'):css('width', '52px') end imageRightCell :wikitext(self.imageRight or nil) end -- Add the below row. if self.below then boxTable:tag('tr') :tag('td') :attr('colspan', self.imageRight and '3' or '2') :addClass('mbox-text') :cssText(self.textstyle or nil) :wikitext(self.below or nil) end -- Add error message for invalid type parameters. if self.invalidTypeError then root:tag('div') :css('text-align', 'center') :wikitext(string.format( 'This message box is using an invalid "type=%s" parameter and needs fixing.', self.type or '' )) end -- Add categories. root:wikitext(self:renderCategories() or nil) return tostring(root) end -------------------------------------------------------------------------------- -- Exports -------------------------------------------------------------------------------- local p, mt = {}, {} function p._exportClasses() -- For testing. return { MessageBox = MessageBox } end function p.main(boxType, args, cfgTables) local box = MessageBox.new(boxType, args, cfgTables or mw.loadData('Module:Message box/configuration')) box:setParameters() box:setCategories() return box:export() end function mt.__index(t, k) return function (frame) if not getArgs then getArgs = require('Module:Arguments').getArgs end return t.main(k, getArgs(frame, {trim = false, removeBlanks = false})) end end return setmetatable(p, mt) 1nbepkek2p3qm3ehkl961fpyrvvricc Module:Message box/configuration 828 50 77 2018-07-24T23:36:25Z Jspidersf 30511844 Created page with "-------------------------------------------------------------------------------- -- Message box configuration -- --..." 77 Scribunto text/plain -------------------------------------------------------------------------------- -- Message box configuration -- -- -- -- This module contains configuration data for [[Module:Message box]]. -- -------------------------------------------------------------------------------- return { ambox = { types = { speedy = { class = 'ambox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'ambox-delete', image = 'Ambox warning pn.svg' }, warning = { -- alias for content class = 'ambox-content', image = 'Ambox important.svg' }, content = { class = 'ambox-content', image = 'Ambox important.svg' }, style = { class = 'ambox-style', image = 'Edit-clear.svg' }, move = { class = 'ambox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'ambox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'ambox-notice', image = 'Information icon4.svg' } }, default = 'notice', allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'}, allowSmall = true, smallParam = 'left', smallClass = 'mbox-small-left', substCheck = true, classes = {'metadata', 'plainlinks', 'ambox'}, imageEmptyCell = true, imageCheckBlank = true, imageSmallSize = '20x20px', imageCellDiv = true, useCollapsibleTextFields = true, imageRightNone = true, sectionDefault = 'article', allowMainspaceCategories = true, templateCategory = 'Article message templates', templateCategoryRequireName = true, templateErrorCategory = 'Article message templates with missing parameters', templateErrorParamsToCheck = {'issue', 'fix', 'subst'} }, cmbox = { types = { speedy = { class = 'cmbox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'cmbox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'cmbox-content', image = 'Ambox important.svg' }, style = { class = 'cmbox-style', image = 'Edit-clear.svg' }, move = { class = 'cmbox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'cmbox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'cmbox-notice', image = 'Information icon4.svg' }, caution = { class = 'cmbox-style', image = 'Ambox warning yellow.svg' } }, default = 'notice', showInvalidTypeError = true, classes = {'plainlinks', 'cmbox'}, imageEmptyCell = true }, fmbox = { types = { warning = { class = 'fmbox-warning', image = 'Ambox warning pn.svg' }, editnotice = { class = 'fmbox-editnotice', image = 'Information icon4.svg' }, system = { class = 'fmbox-system', image = 'Information icon4.svg' } }, default = 'system', showInvalidTypeError = true, classes = {'plainlinks', 'fmbox'}, imageEmptyCell = false, imageRightNone = false }, imbox = { types = { speedy = { class = 'imbox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'imbox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'imbox-content', image = 'Ambox important.svg' }, style = { class = 'imbox-style', image = 'Edit-clear.svg' }, move = { class = 'imbox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'imbox-protection', image = 'Padlock-silver-medium.svg' }, license = { class = 'imbox-license licensetpl', image = 'Imbox license.png' -- @todo We need an SVG version of this }, featured = { class = 'imbox-featured', image = 'Cscr-featured.svg' }, notice = { class = 'imbox-notice', image = 'Information icon4.svg' } }, default = 'notice', showInvalidTypeError = true, classes = {'imbox'}, usePlainlinksParam = true, imageEmptyCell = true, below = true, templateCategory = 'File message boxes' }, ombox = { types = { speedy = { class = 'ombox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'ombox-delete', image = 'Ambox warning pn.svg' }, warning = { -- alias for content class = 'ombox-content', image = 'Ambox important.svg' }, content = { class = 'ombox-content', image = 'Ambox important.svg' }, style = { class = 'ombox-style', image = 'Edit-clear.svg' }, move = { class = 'ombox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'ombox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'ombox-notice', image = 'Information icon4.svg' }, critical = { class = 'mbox-critical', image = 'Ambox warning pn.svg' } }, default = 'notice', showInvalidTypeError = true, classes = {'plainlinks', 'ombox'}, allowSmall = true, imageEmptyCell = true, imageRightNone = true }, tmbox = { types = { speedy = { class = 'tmbox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'tmbox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'tmbox-content', image = 'Ambox important.svg' }, style = { class = 'tmbox-style', image = 'Edit-clear.svg' }, move = { class = 'tmbox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'tmbox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'tmbox-notice', image = 'Information icon4.svg' } }, default = 'notice', showInvalidTypeError = true, classes = {'plainlinks', 'tmbox'}, allowSmall = true, imageRightNone = true, imageEmptyCell = true, imageEmptyCellStyle = true, templateCategory = 'Talk message boxes' } } kdumpv6pv5qre0igyaz2t80xybsyuyn Module:Namespace detect/config 828 51 78 2018-07-24T23:37:04Z Jspidersf 30511844 Created page with "-------------------------------------------------------------------------------- -- Namespace detect configuration data -- --..." 78 Scribunto text/plain -------------------------------------------------------------------------------- -- Namespace detect configuration data -- -- -- -- This module stores configuration data for Module:Namespace detect. Here -- -- you can localise the module to your wiki's language. -- -- -- -- To activate a configuration item, you need to uncomment it. This means -- -- that you need to remove the text "-- " at the start of the line. -- -------------------------------------------------------------------------------- local cfg = {} -- Don't edit this line. -------------------------------------------------------------------------------- -- Parameter names -- -- These configuration items specify custom parameter names. Values added -- -- here will work in addition to the default English parameter names. -- -- To add one extra name, you can use this format: -- -- -- -- cfg.foo = 'parameter name' -- -- -- -- To add multiple names, you can use this format: -- -- -- -- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'} -- -------------------------------------------------------------------------------- ---- This parameter displays content for the main namespace: -- cfg.main = 'main' ---- This parameter displays in talk namespaces: -- cfg.talk = 'talk' ---- This parameter displays content for "other" namespaces (namespaces for which ---- parameters have not been specified): -- cfg.other = 'other' ---- This parameter makes talk pages behave as though they are the corresponding ---- subject namespace. Note that this parameter is used with [[Module:Yesno]]. ---- Edit that module to change the default values of "yes", "no", etc. -- cfg.subjectns = 'subjectns' ---- This parameter sets a demonstration namespace: -- cfg.demospace = 'demospace' ---- This parameter sets a specific page to compare: cfg.demopage = 'page' -------------------------------------------------------------------------------- -- Table configuration -- -- These configuration items allow customisation of the "table" function, -- -- used to generate a table of possible parameters in the module -- -- documentation. -- -------------------------------------------------------------------------------- ---- The header for the namespace column in the wikitable containing the list of ---- possible subject-space parameters. -- cfg.wikitableNamespaceHeader = 'Namespace' ---- The header for the wikitable containing the list of possible subject-space ---- parameters. -- cfg.wikitableAliasesHeader = 'Aliases' -------------------------------------------------------------------------------- -- End of configuration data -- -------------------------------------------------------------------------------- return cfg -- Don't edit this line. a8nxo7wcopem2yd46s1dildj9jjca6c Module:Namespace detect/data 828 52 79 2018-07-24T23:37:32Z Jspidersf 30511844 Created page with "-------------------------------------------------------------------------------- -- Namespace detect data -- -- This modul..." 79 Scribunto text/plain -------------------------------------------------------------------------------- -- Namespace detect data -- -- This module holds data for [[Module:Namespace detect]] to be loaded per -- -- page, rather than per #invoke, for performance reasons. -- -------------------------------------------------------------------------------- local cfg = require('Module:Namespace detect/config') local function addKey(t, key, defaultKey) if key ~= defaultKey then t[#t + 1] = key end end -- Get a table of parameters to query for each default parameter name. -- This allows wikis to customise parameter names in the cfg table while -- ensuring that default parameter names will always work. The cfg table -- values can be added as a string, or as an array of strings. local defaultKeys = { 'main', 'talk', 'other', 'subjectns', 'demospace', 'demopage' } local argKeys = {} for i, defaultKey in ipairs(defaultKeys) do argKeys[defaultKey] = {defaultKey} end for defaultKey, t in pairs(argKeys) do local cfgValue = cfg[defaultKey] local cfgValueType = type(cfgValue) if cfgValueType == 'string' then addKey(t, cfgValue, defaultKey) elseif cfgValueType == 'table' then for i, key in ipairs(cfgValue) do addKey(t, key, defaultKey) end end cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more. end local function getParamMappings() --[[ -- Returns a table of how parameter names map to namespace names. The keys -- are the actual namespace names, in lower case, and the values are the -- possible parameter names for that namespace, also in lower case. The -- table entries are structured like this: -- { -- [''] = {'main'}, -- ['wikipedia'] = {'wikipedia', 'project', 'wp'}, -- ... -- } --]] local mappings = {} local mainNsName = mw.site.subjectNamespaces[0].name mainNsName = mw.ustring.lower(mainNsName) mappings[mainNsName] = mw.clone(argKeys.main) mappings['talk'] = mw.clone(argKeys.talk) for nsid, ns in pairs(mw.site.subjectNamespaces) do if nsid ~= 0 then -- Exclude main namespace. local nsname = mw.ustring.lower(ns.name) local canonicalName = mw.ustring.lower(ns.canonicalName) mappings[nsname] = {nsname} if canonicalName ~= nsname then table.insert(mappings[nsname], canonicalName) end for _, alias in ipairs(ns.aliases) do table.insert(mappings[nsname], mw.ustring.lower(alias)) end end end return mappings end return { argKeys = argKeys, cfg = cfg, mappings = getParamMappings() } gjhuvy6qr3776fkmepa3doqbn7nwte2 Module:No globals 828 53 80 2018-07-24T23:38:02Z Jspidersf 30511844 Created page with "local mt = getmetatable(_G) or {} function mt.__index (t, k) if k ~= 'arg' then error('Tried to read nil global ' .. tostring(k), 2) end return nil end function mt.__newi..." 80 Scribunto text/plain local mt = getmetatable(_G) or {} function mt.__index (t, k) if k ~= 'arg' then error('Tried to read nil global ' .. tostring(k), 2) end return nil end function mt.__newindex(t, k, v) if k ~= 'arg' then error('Tried to write global ' .. tostring(k), 2) end rawset(t, k, v) end setmetatable(_G, mt) gggsv54pq7f94l3up48hr91qtxnskdm Module:Template translation 828 54 81 2018-07-24T23:38:23Z Jspidersf 30511844 Created page with "local this = {} function this.checkLanguage(subpage, default) --[[Check first if there's an any invalid character that would cause the mw.language.isKnownLanguage..." 81 Scribunto text/plain local this = {} function this.checkLanguage(subpage, default) --[[Check first if there's an any invalid character that would cause the mw.language.isKnownLanguageTag function() to throw an exception: - all ASCII controls in [\000-\031\127], - double quote ("), sharp sign (#), ampersand (&), apostrophe ('), - slash (/), colon (:), semicolon (;), lower than (<), greater than (>), - brackets and braces ([, ], {, }), pipe (|), backslash (\\) All other characters are accepted, including space and all non-ASCII characters (including \192, which is invalid in UTF-8). --]] if mw.language.isValidCode(subpage) and mw.language.isKnownLanguageTag(subpage) --[[However "SupportedLanguages" are too restrictive, as they discard many valid BCP47 script variants (only because MediaWiki still does not define automatic transliterators for them, e.g. "en-dsrt" or "fr-brai" for French transliteration in Braille), and country variants, (useful in localized data, even if they are no longer used for translations, such as zh-cn, also useful for legacy codes). We want to avoid matching subpagenames containing any uppercase letter, (even if they are considered valid in BCP 47, in which they are case-insensitive; they are not "SupportedLanguages" for MediaWiki, so they are not "KnownLanguageTags" for MediaWiki). To be more restrictive, we exclude any character * that is not ASCII and not a lowercase letter, minus-hyphen, or digit, or does not start by a letter or does not finish by a letter or digit; * or that has more than 8 characters between hyphens; * or that has two hyphens; * or with specific uses in template subpages and unusable as languages. --]] or string.find(subpage, "^[%l][%-%d%l]*[%d%l]$") ~= nil and string.find(subpage, "[%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l]") == nil and string.find(subpage, "%-%-") == nil and subpage ~= "doc" and subpage ~= "layout" and subpage ~= "sandbox" and subpage ~= "testcases" then return subpage end -- Otherwise there's currently no known language subpage return default end --[[Get the last subpage of the current page if it is a translation. ]] function this.getLanguageSubpage() --[[This code does not work in all namespaces where the Translate tool works. -- It works in the main namespace on Meta because it allows subpages there -- It would not work in the main namespace of English Wikipedia (but the -- articles are monolignual on that wiki). -- On Meta-Wiki the main space uses subpages and its pages are translated. -- The Translate tool allows translatng pages in all namespaces, even if -- the namespace officially does not have subpages. -- On Meta-Wiki the Category namespace still does not have subpages enabled, -- even if they would be very useful for categorizing templates, that DO have -- subpages (for documentatio and tstboxes pages). This is a misconfiguration -- bug of Meta-Wiki. The work-around is to split the full title and then -- get the last titlepart. local subpage = mw.title.getCurrentTitle().subpageText --]] local titleparts = mw.text.split(mw.title.getCurrentTitle().fullText, '/') local subpage = titleparts[#titleparts] return this.checkLanguage(subpage, '') end --[[Get the first part of the language code of the subpage, before the '-'. ]] function this.getMainLanguageSubpage() parts = mw.text.split( this.getLanguageSubpage(), '-' ) return parts[1] end --[[Get the last subpage of the current frame if it is a translation. Not used locally. ]] function this.getFrameLanguageSubpage(frame) local titleparts = mw.text.split(frame:getParent():getTitle(), '/') local subpage = titleparts[#titleparts] return this.checkLanguage(subpage, '') end --[[Get the language of the current page. Not used locally. ]] function this.getLanguage() local subpage = mw.title.getCurrentTitle().subpageText return this.checkLanguage(subpage, mw.language.getContentLanguage():getCode()) end --[[Get the language of the current frame. Not used locally. ]] function this.getFrameLanguage(frame) local titleparts = mw.text.split(frame:getParent():getTitle(), '/') local subpage = titleparts[#titleparts] return this.checkLanguage(subpage, mw.language.getContentLanguage():getCode()) end function this.title(namespace, basepagename, subpage) local message, title local pagename = basepagename if (subpage or '') ~= '' then pagename = pagename .. '/' .. subpage end local valid, title = xpcall(function() return mw.title.new(pagename, namespace) -- costly end, function(msg) -- catch undocumented exception (!?) -- thrown when namespace does not exist. The doc still -- says it should return a title, even in that case... message = msg end) if valid and title ~= nil and (title.id or 0) ~= 0 then return title end return { -- "pseudo" mw.title object with id = nil in case of error prefixedText = pagename, -- the only property we need below message = message -- only for debugging } end --[[If on a translation subpage (like Foobar/de), this function returns a given template in the same language, if the translation is available. Otherwise, the template is returned in its default language, without modification. This is aimed at replacing the current implementation of Template:TNTN. This version does not expand the returned template name: this solves the problem of self-recursion in TNT when translatable templates need themselves to transclude other translable templates (such as Tnavbar). ]] function this.getTranslatedTemplate(frame, withStatus) local args = frame.args local pagename = args['template'] --[[Check whether the pagename is actually in the Template namespace, or if we're transcluding a main-namespace page. (added for backward compatibility of Template:TNT) ]] local title local namespace = args['tntns'] or '' if (namespace ~= '') -- Checks for tntns parameter for custom ns. then title = this.title(namespace, pagename) -- Costly else -- Supposes that set page is in ns10. namespace = 'Template' title = this.title(namespace, pagename) -- Costly if title.id == nil then -- not found in the Template namespace, assume the main namespace (for backward compatibility) namespace = '' title = this.title(namespace, pagename) -- Costly end end -- Get the last subpage and check if it matches a known language code. local subpage = args['uselang'] or '' if (subpage == '') then subpage = this.getLanguageSubpage() end if (subpage == '') then -- Check if a translation of the pagename exists in English local newtitle = this.title(namespace, pagename, 'en') -- Costly -- Use the translation when it exists if newtitle.id ~= nil then title = newtitle end else -- Check if a translation of the pagename exists in that language local newtitle = this.title(namespace, pagename, subpage) -- Costly if newtitle.id == nil then -- Check if a translation of the pagename exists in English newtitle = this.title(namespace, pagename, 'en') -- Costly end -- Use the translation when it exists if newtitle.id ~= nil then title = newtitle end end -- At this point the title should exist if withStatus then -- status returned to Lua function below return title.prefixedText, title.id ~= nil else -- returned directly to MediaWiki return title.prefixedText end end --[[If on a translation subpage (like Foobar/de), this function renders a given template in the same language, if the translation is available. Otherwise, the template is rendered in its default language, without modification. This is aimed at replacing the current implementation of Template:TNT. Note that translatable templates cannot transclude themselves other translatable templates, as it will recurse on TNT. Use TNTN instead to return only the effective template name to expand externally, with template parameters also provided externally. ]] function this.renderTranslatedTemplate(frame) local title, found = this.getTranslatedTemplate(frame, true) -- At this point the title should exist prior to performing the expansion -- of the template, otherwise render a red link to the missing page -- (resolved in its assumed namespace). If we don't tet this here, a -- script error would be thrown. Returning a red link is consistant with -- MediaWiki behavior when attempting to transclude inexistant templates. if not found then return '[[' .. title .. ']]' end -- Copy args pseudo-table to a proper table so we can feed it to expandTemplate. -- Then render the pagename. local args = frame.args local pargs = (frame:getParent() or {}).args local arguments = {} if (args['noshift'] or '') == '' then for k, v in pairs(pargs) do -- numbered args >= 1 need to be shifted local n = tonumber(k) or 0 if (n > 0) then if (n >= 2) then arguments[n - 1] = v end else arguments[k] = v end end else -- special case where TNT is used as autotranslate -- (don't shift again what is shifted in the invokation) for k, v in pairs(pargs) do arguments[k] = v end end arguments['template'] = title -- override the existing parameter of the base template name supplied with the full name of the actual template expanded arguments['tntns'] = nil -- discard the specified namespace override arguments['uselang'] = args['uselang'] -- argument forwarded into parent frame arguments['noshift'] = args['noshift'] -- argument forwarded into parent frame return frame:expandTemplate{title = ':' .. title, args = arguments} end --[[A helper for mocking TNT in Special:TemplateSandbox. TNT breaks TemplateSandbox; mocking it with this method means templates won't be localized but at least TemplateSandbox substitutions will work properly. Won't work with complex uses. ]] function this.mockTNT(frame) local pargs = (frame:getParent() or {}).args local arguments = {} for k, v in pairs(pargs) do -- numbered args >= 1 need to be shifted local n = tonumber(k) or 0 if (n > 0) then if (n >= 2) then arguments[n - 1] = v end else arguments[k] = v end end if not pargs[1] then return '' end return frame:expandTemplate{title = 'Template:' .. pargs[1], args = arguments} end return this 24xr7n0xqjpyo8jhqlzhh76jcvbx5fc Module:Yesno 828 55 82 2018-07-24T23:38:44Z Jspidersf 30511844 Created page with "-- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template {{yesno}}. return function (val, default) -- If your wiki..." 82 Scribunto text/plain -- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template {{yesno}}. return function (val, default) -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you -- should replace "val:lower()" with "mw.ustring.lower(val)" in the -- following line. val = type(val) == 'string' and val:lower() or val if val == nil then return nil elseif val == true or val == 'yes' or val == 'y' or val == 'true' or val == 't' or tonumber(val) == 1 then return true elseif val == false or val == 'no' or val == 'n' or val == 'false' or val == 'f' or tonumber(val) == 0 then return false else return default end end 266x81qzpz9iq1b5gft4zsdy5qzbnwi